大容量存储结构

来源:互联网 发布:iw引擎知乎 编辑:程序博客网 时间:2024/06/10 08:50

一、要点

*

磁盘结构

Disk Structure

*

磁盘调度

Disk Scheduling

*

磁盘管理

Disk Management

*

交换空间管理

Swap-Space Management

*

磁盘可靠性

Disk Reliability

*

稳定存储实现

Stable-Storage Implementation

*

三级存储设备

Tertiary Storage Devices

*

有关操作系统的问题

Operating System Issues

*

有关性能的问题

Performance Issues

二、内容简介

Disk Structure 磁盘结构

*

磁盘设备是以一种逻辑块的一维大数组的形式编址的,这里的逻辑块是传输的最小单位


Disk drives are addressed as large 1-dimensional arrays of logical blocks , where the logical block is the smallest unit of transfer

*

逻辑块的一维数组映射到磁盘上一些相连的扇区


The 1-dimensional array of logical blocks is mapped into the sectors of the disk sequentially


0 扇区是最外边柱面的第一个磁道的第一个扇区


Sector 0 is the first sector of the first track on the outermost cylinder


数据首先都映射到一个磁道,其余的数据映射到同一柱面的其他磁道,然后按照从外向里的顺序映射到其余的柱面


Mapping proceeds in order through that track, then the rest of the tracks in that cylinder, and then through the rest of the cylinders from outermost to innermost

Disk Scheduling 磁盘调度

*

操作系统有责任高效地使用硬件 —— 对于磁盘设备,这意味着很短的访问时间和磁盘带宽


The operating system is responsible for using hardware efficiently — for the disk drives, this means having a fast access time and disk bandwidth

*

访问时间包括两个主要部分


Access time has two major components


寻道时间是指把磁头移到所需柱面的时间


Seek time is the time for the disk are to move the heads to the cylinder containing the desired sector


旋转延迟是指等待磁盘上所需要的扇区旋转到磁头下面的时间


Rotational latency is the additional time waiting for the disk to rotate the desired sector to the disk head

*

最小寻道时间


Minimize seek time

*

寻道时间 ? 寻道距离


Seek time ? seek distance

*

磁盘带宽,是用传输的总位数,除以第一个服务请求与最后传输完成之间的总时间


Disk bandwidth is the total number of bytes transferred, divided by the total time between the first request for service and the completion of the last transfer

FCFS 先来先服务

SSTF 最短寻道时间优先

*

选择从当前磁头位置所需寻道时间最短的请求


Selects the request with the minimum seek time from the current head position

*

SSTF 是 SJF 调度的一种形式;有可能引起某些请求的饥饿


SSTF scheduling is a form of SJF scheduling; may cause starvation of some requests

*

如图所示,磁头移动的总距离是 236 柱面


Illustration shows total head movement of 236 cylinders

SCAN 扫描算法

*

磁头从磁盘的一端开始向另一端移动,沿途响应访问请求,直到到达了磁盘的另一端,此时磁头反向移动并继续响应服务请求


The disk arm starts at one end of the disk, and moves toward the other end, servicing requests until it gets to the other end of the disk, where the head movement is reversed and servicing continues

*

有时也称为电梯算法


Sometimes called the elevator algorithm

*

如图所示,磁头移动的总距离是 208 柱面


Illustration shows total head movement of 208 cylinders

Disk Management 磁盘管理

*

低级格式化,或物理格式化 —— 把磁盘划分成扇区,以便磁盘控制器可以进行读写


Low-level formatting , or physical formatting — Dividing a disk into sectors that the disk controller can read and write

*

为了使用磁盘保存文件,操作系统还需要在磁盘上保存它自身的数据结构


To use a disk to hold files, the operating system still needs to record its own data structures on the disk


把磁盘划分成一组或多组柱面


Partition the disk into one or more groups of cylinders


逻辑格式化或“创建文件系统”


Logical formatting or “making a file system”

*

启动块初始化系统


Boot block initializes system


引导程序存储在 ROM 中


The bootstrap is stored in ROM


引导程序装载程序


Bootstrap loader program

*

一些方法,例如节省扇区,可以用来处理坏块


Methods such as sector sparing used to handle bad blocks

Swap-Space Management 交换空间管理

*

交换空间 —— 虚拟内存使用磁盘空间作为对主存的扩展


Swap-space — Virtual memory uses disk space as an extension of main memory

*

交换空间可以与常规的文件系统分离开,或者更通常的情况是放在一个单独的磁盘分区里


Swap-space can be carved out of the normal file system,or, more commonly, it can be in a separate disk partition

*

交换空间管理


Swap-space management


4.3BSD 在程序开始时分配交换空间;保存正文段(程序)和数据段


4.3BSD allocates swap space when process starts; holds text segment (the program) and data segment


核心使用交换映射跟踪交换空间的使用情况


Kernel uses swap maps to track swap-space use


Solaris 2 仅在一页被交换出物理内存的时候分配交换空间,而不是在虚拟内存页最初生成的时候


Solaris 2 allocates swap space only when a page is forced out of physical memory, not when the virtual memory page is first created

Disk Reliability 磁盘可靠性

*

磁盘使用技术中,有几种实现都包括了使用多个磁盘协同工作方式


Several improvements in disk-use techniques involve the use of multiple disks working cooperatively

*

磁盘条使用一组磁盘作为一个存储单元


Disk striping uses a group of disks as one storage unit

*

RAID 系统依靠存储冗余数据改善了存储系统的性能和可靠性


RAID schemes improve performance and improve the reliability of the storage system by storing redundant data


镜像或影像为每个磁盘保存了备份


Mirroring or shadowing keeps duplicate of each disk


块交叉奇偶方式大大地减少了冗余


Block interleaved parity uses much less redundancy

Stable-Storage Implementation 稳定存储实现

*

向前写日志系统需要稳定存储


Write-ahead log scheme requires stable storage

*

为了实现稳定存储


To implement stable storage


在多个非易失性存储介质上备份信息,这些介质具有不同的故障方式


Replicate information on more than one nonvolatile storage media with independent failure modes


以一种有控制的方式更新信息,以便确保在数据传输或修复的过程中发生错误以后我们能够恢复稳定的数据


Update information in a controlled manner to ensure that we can recover the stable data after any failure during data transfer or recovery

Tertiary Storage Devices 三级存储设备

*

三级存储的定义特征是低成本


Low cost is the defining characteristic of tertiary storage

*

通常,三级存储由可移动介质构成


Generally, tertiary storage is built usingremovable media

*

通常的可移动介质的例子是软盘和光盘;其他还有一些类型


Common examples of removable media are floppy disks and CD-ROMs; other types are available

Removable Disks 可移动磁盘

*

软盘 —— 在又薄又软的盘面上涂上磁介质,装在一个用于保护的塑料套中


Floppy disk — thin flexible disk coated with magnetic material, enclosed in a protective plastic case


大多数软盘的容量是 1MB ;类似的技术也用于可移动磁盘,其容量大于 1GB


Most floppies hold about 1 MB; similar technology is used for removable disks that hold more than 1 GB


可移动磁盘的速度几乎与硬盘一样快,但由于是暴露在外的,损坏的风险更大


Removable magnetic disks can be nearly as fast as hard disks, but they are at a greater risk of damage from exposure

Application Interface 应用程序接口

*

多数操作系统处理可移动磁盘的方式与固定磁盘几乎是一样的 —— 格式化一个新的盘碟,同时在盘上生成一个空的文件系统


Most OSs handle removable disks almost exactly like fixed disks — a new cartridge is formatted and an empty file system is generated on the disk

*

磁带作为一个 raw 存储介质,也就是说,应用程序不是打开磁带上的一个文件,而是作为 raw 设备打开整个磁带


Tapes are presented as a raw storage medium, i.e., and application does not not open a file on the tape, it opens the whole tape drive as a raw device

*

通常磁带设备是由一个应用程序独占使用的


Usually the tape drive is reserved for the exclusive use of that application

*

由于操作系统不提供文件系统服务,应用程序必须决定如何使用数据块的数组


Since the OS does not provide file system services, the application must decide how to use the array of blocks

*

由于每个应用程序对于如何组织一个磁带都建立了自己的规则,一个装满数据的磁带通常只能由创建它的应用程序来使用


Since every application makes up its own rules for how to organize a tape, a tape full of data can generally only be used by the program that created it

File Naming 文件命名

*

台计算机的一个可移动盘碟写入数据、然后在另一台计算机中使用的时候,命名文件的问题在可移动媒介上更加困难


The issue of naming files on removable media is especially difficult when we want to write data on a removable cartridge on one computer, and then use the cartridge in another computer

*

现代操作系统通常没有解决可移动媒介上的命名空间问题,而是依靠应用程序和用户来指出如何访问解释数据


Contemporary OSs generally leave the name space problem unsolved for removable media, and depend on applications and users to figure out how to access and interpret the data

*

一些可移动介质(比如 CD )相当的规格化,所有的计算机都以同样的方式使用它们


Some kinds of removable media (e.g., CDs) are so well standardized that all computers use them the same way

Hierarchical Storage Management (HSM) 层次存储管理

*

一个层次存储系统扩展了存储层次,从主存、二级存储到一体化的三级存储 —— 通常是一个磁带的自动播放机或者可移动磁盘


A hierarchical storage system extends the storage hierarchy beyond primary memory and secondary storage to incorporate tertiary storage — usually implemented as a jukebox of tapes or removable disks

*

通常通过扩展文件系统来一体化三级存储


Small and frequently used files remain on disk


经常使用的小文件仍然存在磁盘上


Port


不使用的大的旧文件存在自动播放机上


Large, old, inactive files are archived to the jukebox

*

HSM 在超级计算中心和其他有庞大数据量的大设备中比较常见


HSM is usually found in supercomputing centers and other large installaitons that have enormous volumes of data

Speed 速度

*

三级存储速度的两个方面是带宽和延迟


Two aspects of speed in tertiary storage are bandwidth and latency

*

带宽用每秒字节数来衡量


Bandwidth is measured in bytes per second


持续的带宽 —— 大量传输过程中的平均数据率;单位传输时间的字节数。数据流实际流动时的数据率


Sustained bandwidth – average data rate during a large transfer; # of bytes/transfer time Data rate when the data stream is actually flowing


有效带宽 —— 整个 I/O 时间的平均,包括寻道或者定位,以及盘碟选择。驱动器的全面数据率


Effective bandwidth – average over the entire I/O time, including seek or locate , and cartridge switching Drive's overall data rate

Reliability 可靠性

*

固定磁盘驱动器比可移动磁盘或磁带驱动器更可靠


A fixed disk drive is likely to be more reliable than a removable disk or tape drive

*

光介质比磁介质的磁盘或磁带更可靠


An optical cartridge is likely to be more reliable than a magnetic disk or tape

*

对于固定的硬盘,磁头撞击通常会破坏数据,然而磁带或光盘驱动器的错误通常对数据盘碟是无害的


A head crash in a fixed hard disk generally destroys the data, whereas the failure of a tape drive or optical disk drive often leaves the data cartridge unharmed

Cost 成本

*

主存比磁盘存储要贵很多


Main memory is much more expensive than disk storage

*

硬盘存储的每兆字节成本与磁带不相上下,如果每个驱动器只用一条磁带


The cost per megabyte of hard disk storage is competitive with magnetic tape if only one tape is used per drive

*

近年来,最便宜的磁带驱动器和最便宜的磁盘驱动器的存储容量几乎一样


The cheapest tape drives and the cheapest disk drives have had about the same storage capacity over the years

*

只有当盘碟的数量远大于驱动器数量的时候,三级存储才能节约成本


Tertiary storage gives a cost savings only when the number of cartridges is considerably larger than the number of drives

原创粉丝点击