Chapter 14 mass storage structure
This presentation is the property of its rightful owner.
Sponsored Links
1 / 48

Chapter 14: Mass-Storage Structure PowerPoint PPT Presentation

  • Uploaded on
  • Presentation posted in: General

Chapter 14: Mass-Storage Structure. Chapter 14: Mass-Storage Structure 大容量存储结构. 14.1 Disk Structure 磁盘结构 14.2 Disk Scheduling 磁盘调度 14. 3 Disk Management 磁盘管理 14.4 Swap-Space Management 对换空间管理 14.5 RAID Structure RAID 结构 14.6 Disk Attachment 磁盘配置

Download Presentation

Chapter 14: Mass-Storage Structure

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript

Chapter 14 mass storage structure

Chapter 14: Mass-Storage Structure

Chapter 14 mass storage structure1

Chapter 14: Mass-Storage Structure大容量存储结构

  • 14.1Disk Structure 磁盘结构

  • 14.2Disk Scheduling磁盘调度

  • 14. 3Disk Management磁盘管理

  • 14.4 Swap-Space Management对换空间管理

  • 14.5RAID StructureRAID结构

  • 14.6 Disk Attachment磁盘配置

  • 14.7Stable-Storage Implementation稳定存储的实现

  • 14.8Tertiary-Storage Structure三级存储结构

14 1 disk structure

14.1 Disk Structure磁盘结构

  • Magnetic disks provide bulk of secondary storage of modern computers


    • Drives rotate at 60 to 200 times per second

    • Transfer rate 传输率

      • rate at which data flow between drive and computer

    • Positioning time (random-access time) 定位时间

      • is time to move disk arm to desired cylinder (seek time)

      • and time for desired sector to rotate under the disk head (rotational latency)

    • Head crash 磁头碰撞

      • results from disk head making contact with the disk surface

        • That’s bad

Moving head disk mechanism

<Moving-head Disk Mechanism>>

Chapter 14 mass storage structure

  • Disks can be removable(可移动的)

  • Drive attached to computer via I/O bus

    • Busses vary, including EIDE, ATA, SATA, USB, Fibre Channel, SCSI

    • Host controller in computer uses bus to talk to disk controller built into drive or storage array

Chapter 14 mass storage structure

  • Magnetic tape 磁带

    • Was early secondary-storage medium

    • Relatively permanent and holds large quantities of data

    • Access time slow

    • Random access ~1000 times slower than disk

    • Mainly used for backup, storage of infrequently-used data, transfer medium between systems

    • Kept in spool and wound or rewound past read-write head

    • Once data under head, transfer rates comparable to disk

    • 20-200GB typical storage

    • Common technologies are 4mm, 8mm, 19mm, LTO-2 and SDLT

Chapter 14 mass storage structure

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


Chapter 14 mass storage structure

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


    • 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.

14 2 disk scheduling

14.2 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 timehas 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.


    • Transfer time (传输时间)

Chapter 14 mass storage structure

  • Minimize seek time 最小化寻道时间

    • Seek time  seek distance

  • Disk bandwidth 磁盘带宽

    • the total number of bytes transferred, divided by the total time between the first request for service and the completion of the last transfer.

      总传输字节数, 除以总时间(从第一个服务请求到最后一次传输结束)

Disk scheduling cont

Disk Scheduling (Cont.)

  • Several algorithms exist to schedule the servicing of disk I/O requests.

  • We illustrate them with a request queue (0-199).

    98, 183, 37, 122, 14, 124, 65, 67

    Head pointer 53

1 fcfs scheduling

1. FCFS Scheduling

Illustration shows total head movement of 640 cylinders.

2 sstf scheduling

2. SSTF Scheduling

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


    • a form of SJF scheduling;


    • may cause starvation of some requests.


Chapter 14 mass storage structure

SSTF disk scheduling

(Illustration shows total head movement of 236 cylinders.)

3 scan scheduling

3. SCAN Scheduling

  • 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(电梯算法).

  • LOOK

Chapter 14 mass storage structure

SCAN disk scheduling

Illustration shows total head movement of 208 cylinders.

4 c scan


  • Provides a more uniform wait time than SCAN.


  • The head moves from one end of the disk to the other. servicing requests as it goes. When it reaches the other end, however, it immediately returns to the beginning of the disk, without servicing any requests on the return trip.


    • Treats the cylinders as a circular list that wraps around from the last cylinder to the first one.


Chapter 14 mass storage structure

C-SCAN disk scheduling

5 c look


  • Version of C-SCAN

  • Arm only goes as far as the last request in each direction, then reverses direction immediately, without first going all the way to the end of the disk.


Chapter 14 mass storage structure

C-LOOK disk scheduling

6 selecting a disk scheduling algorithm

6. Selecting a Disk-Scheduling Algorithm

  • SSTF is common and has a natural appeal


  • SCAN and C-SCAN perform better for systems that place a heavy load on the disk.


  • Performance depends on the number and types of requests.


  • Requests for disk service can be influenced by the file-allocation method.


Chapter 14 mass storage structure

  • The disk-scheduling algorithm should be written as a separate module of the operating system, allowing it to be replaced with a different algorithm if necessary.


  • Either SSTF or LOOK is a reasonable choice for the default algorithm.


14 3 disk management

14.3 Disk Management 磁盘管理

  • disk initialization 磁盘初始化

  • booting from disk 由磁盘引导

  • bad-block recovery 坏块恢复

1 disk formatting

1. Disk Formatting 磁盘格式化

  • Low-level formatting, or physical formatting


    • — Dividing a disk into sectors that the disk controller can read and write, and filling the disk with a special data structure for each sector:


      • A header:

      • A data area(usually 512 bytes in size):

      • A trailer:

    • The header and trailer contain information used by the disk controller, such as a sector number and an error-correctingcode(ECC)


Chapter 14 mass storage structure

  • Partition & Logical formatting分区和逻辑格式化

    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”.


Chapter 14 mass storage structure

  • raw disk, raw I/O 生磁盘及生I/O

    • Some operating systems give special programs the ability to use a disk partition as a large sequential array of logical blocks, without any file-system data structures. ---raw disk, raw I/O


      For example, some database systems prefer raw I/O because it enables them to control the exact disk location where each database record is stored.


2 boot block

2. Boot Block 引导块

  • Boot block initializes system.引导块初始化系统

    • The bootstrap program initializes all aspects of the system---CPU registers, device controllers, and the contents of main memory---and then starts the OS.


    • The bootstrap is stored in ROM. 自举程序存储在ROM中

Chapter 14 mass storage structure

  • Most systems store a tiny bootstrap loader program in the boot ROM, whose only job is to bring in a full bootstrap program from disk. The full bootstrap program can be changed easily.


    • Boot block: a disk partition in which the full bootstrap program is stored.


    • Boot disk or system disk: a disk that has a boot partition.


Chapter 14 mass storage structure

MS-DOS Disk Layout

3 bad blocks

3 . Bad Blocks 坏块

  • On simple disks, such as some disk with IDE controllers, bad blocks are handled manually.


    • If the MS-DOS format command find a bad block while it does a logical format, its writes a special value into the corresponding FAT entry to tell the allocation routines not to use that block.


    • Chkdsk:搜索坏块,并标记

Chapter 14 mass storage structure

  • More sophisticated disks, such as the SCSI disks used in high-end PCs and workstations and servers, are smarter about bad-block recovery.


    • The controller maintains a list of bad blocks on the disk. The list is initialized during the low-level format at the factory, and is updated over the life of the disk.


Chapter 14 mass storage structure

  • Low-level formatting also sets aside spare sectors not visible to the operating system. The controller can be told to replace each bad sector logically with one of the spare sectors. ---sector sparing or forwarding.


14 4 swap space management

14.4 Swap-Space Management对换空间管理

  • Swap-space

    • — Virtual memory uses disk space as an extension of main memory.

    • The main goal for the design and implementation of swap space

      • provide the best throughput for the virtual-memory system.

1 swap space use

1. Swap-Space Use 对换空间的使用

  • Swap space is used in various ways by different operating system, depending on the implemented memory-management algorithms.

    • Systems that implement swapping may use swap space to hold the entire process image.

    • Paging systems may simply store pages that have been pushed out of main memory.

  • The amount of swap space needed on a system can vary depending on the amount of physical memory, the amount of virtual memory it is backing, and the way in which the virtual memory is used.

2 swap space location

2. Swap-Space Location 对换空间的位置

  • Swap-space can be carved out of the normal file system


    the swap space is simply a large file within the file system, normal file-system routines can be used to create it, name it, and allocate its space.

  • More commonly, swap space can be in a separate disk partition.


    No file system or directory structure is placed on this space. Rather, a separate swap-space storage manager is used to allocate and deallocate the blocks. This manager uses algorithms optimized for speed, rather than for storage efficiency.

  • Some operating systems are flexible and can swap both in raw partitions and in file-system space.

14 5 raid structure raid

14.5 RAID Structure RAID结构

  • RAID: redundant arrays of inexpensive disks. 廉价磁盘冗余阵列

    • Disk striping uses a group of disks as one storage unit.

    • multiple disk drives provides:

      • High Performance via parallelism

      • Reliability via redundancy.

    • Today, RAIDs are used for their higher reliability and higher data-transfer-rate, rather than for economic reasons. Hence, RAID means redundant arrays of independent disks

Chapter 14 mass storage structure

  • 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 interleavedparity(奇偶校验)uses much less redundancy.

    • RAID is arranged into six different levels.

Raid levels

RAID Levels

Raid 0 1 and 1 0

RAID (0 + 1) and (1 + 0)

14 6 disk attachment

14.6 DiskAttachment 磁盘配置

  • Host-attached storage(HAS)

    accessed through I/O ports talking to I/O busses

    • SCSI itself is a bus, up to 16 devices on one cable

      • SCSI initiator(引导器):requests operation

      • SCSI targets(目标--存储设备):perform tasks

        • Each target can have up to 8 logical units (disks attached to device controller)

    • FC(--fibre channel光纤通道) is high-speed serial architecture

      • Can be switched fabric(交换结构) with 24-bit address space – the basis of storage area networks (SANs--存储区域网络) in which many hosts attach to many storage units

      • Can be arbitrated loop (FC-AL--裁定循环) of 126 devices

  • Network-attached storage (NAS)

14 7 stable storage implementation

14.7 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.


14 8 tertiary storage devices

14.8 Tertiary Storage Devices三级存储设备

  • Low cost is the defining characteristic of tertiary storage.

  • Generally, tertiary storage is built using removable media

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

Removable disks

Removable Disks

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

    • 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.

Removable disks cont

Removable Disks (Cont.)

  • A magneto-optic disk records data on a rigid platter coated with magnetic material.

    • Laser heat is used to amplify a large, weak magnetic field to record a bit.

    • Laser light is also used to read data (Kerr effect).

    • The magneto-optic head flies much farther from the disk surface than a magnetic disk head, and the magnetic material is covered with a protective layer of plastic or glass; resistant to head crashes.

  • Optical disks do not use magnetism; they employ special materials that are altered by laser light.

Worm disks

WORM Disks

  • The data on read-write disks can be modified over and over.

  • WORM (“Write Once, Read Many Times”) disks can be written only once.

  • Thin aluminum film sandwiched between two glass or plastic platters.

  • To write a bit, the drive uses a laser light to burn a small hole through the aluminum; information can be destroyed by not altered.

  • Very durable and reliable.

  • Read Only disks, such ad CD-ROM and DVD, com from the factory with the data pre-recorded.



  • Compared to a disk, a tape is less expensive and holds more data, but random access is much slower.

  • Tape is an economical medium for purposes that do not require fast random access, e.g., backup copies of disk data, holding huge volumes of data.

  • Large tape installations typically use robotic tape changers that move tapes between tape drives and storage slots in a tape library.

  • A disk-resident file can be archived to tape for low cost storage; the computer can stage it back into disk storage for active use.



  • Suppose that a disk drive has 5,000 cylinders, numbered 0 to 4999. The drive is currently serving a request at cylinder 143, and the previous request was at cylinder 125. The queue of pending requests, in FIFO order, is

    86, 1470, 913, 1774, 948, 1509, 1022, 1750, 130.

    Starting from the current head position, what is the total distance (in cylinders) that the disk arm moves to satisfy all the pending requests for each of the following disk-scheduling algorithms?


End of chapter 14

End of Chapter 14

  • Login