Mass-Storage Systems
Chapter 11
Sections: 11.1, 11.2, 11.3, 11.5, 11.6
Objectives
◼ Describe the physical structures of various secondary storage devices and
the effect of a device's structure on its uses.
◼ Explain the performance characteristics of mass-storage devices.
◼ Evaluate I/O scheduling algorithms.
2
Chapter Outline
◼ Overview of Mass Storage Structure
◼ Disk Structure
◼ Disk Scheduling
◼ Disk Management
◼ Swap-Space Management
3
Overview of Mass Storage Structure …
◼ Computer systems must provide mass storage for permanently storing files & data.
◼ Modern computers implement mass storage as secondary storage, using both hard
disks and nonvolatile memory devices.
◼ Secondary storage devices are in many ways the slowest major component of the
computer and vary in many aspects, such as
◼ speed
◼ character vs block
◼ Sequentially vs randomly
◼ Synchronous vs asynchronous
◼ Dedicated vs shared
◼ Read-only vs read-write
4
-- Moving-head Disk Mechanism
5
Hard Disk
6
Tracks and Sectors
7
The First Commercial Disk Drive
1956
IBM RAMDAC computer included
the IBM Model 350 disk storage
system
5M (7 bit) characters
50 x 24” platters
Access time = < 1 second
8
Hard Disk Drives (HDD)
◼ Platters range from .85” to 14” (historically)
◼ Commonly 3.5”, 2.5”, and 1.8”
◼ Range from 30GB to 3TB per drive
◼ Performance
◼ Transfer Rate – theoretical – 6 Gb/sec
◼ Effective Transfer Rate – real – 1 Gb/sec
◼ Seek time from 3ms to 12ms – 9ms common for
desktop drives
◼ Average seek time measured or calculated based
on 1/3 of tracks
◼ Latency based on spindle speed
◼ Average spindle speed 7200 RPM
- Overview of Mass Storage Structure
◼ Bulk of secondary storage for modern computers is hard disk drives (HDDs) and
nonvolatile memory (NVM) devices
◼ HDDs spin platters of magnetically-coated material under moving read-write
heads
◼ Drives rotate at 60 to 250 times per second
◼ 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)
◼ Transfer rate is the rate at which data flow between drive and computer
◼ Head crash results from disk head making contact with the disk surface.
10
NVM
◼ Nonvolatile memory used like HDD. Example: SSD and USB.
◼ Many technology variations
◼ Can be more reliable than HDDs
◼ No moving parts, so no seek time or rotational latency
◼ More expensive per MB
◼ Less capacity
◼ much faster
◼ May have shorter life span, which is measured in drive writes per day (DWPD)
◼ Read and written in pages but can’t overwrite in place
◼ Must first be erased, and erases happen in larger ”block” increments
◼ Can only be erased a limited number of times before worn out – ~ 100,000
11
- 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.
◼ 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.
12
- Disk Scheduling …
◼ The OS 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: Time spent by the disk to move the disk heads to the cylinder
containing the desired sector.
◼ Rotational latency: The additional time spent by 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.
13
… - Disk Scheduling
◼ Several algorithms exist to schedule the servicing of disk I/O requests.
◼ FCFS
◼ SCAN
◼ C-SCAN
◼ We illustrate them with a request queue (0-199).
98, 183, 37, 122, 14, 124, 65, 67
Head pointer 53
14
-- FCFS
Illustration shows total head movement of 640 cylinders.
15
-- 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.
◼ Illustration shows total head movement of 236 cylinders.
16
… -- SCAN
17
-- 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.
18
… -- C-SCAN
19
-- Selecting a Disk-Scheduling Algorithm
◼ SCAN and C-SCAN perform better for systems that place a heavy load on the
disk.
◼ Less starvation, but still possible
◼ To avoid starvation Linux implements deadline scheduler
◼ Performance depends on the number and types of requests.
◼ Requests for disk service can be influenced by the file-allocation method.
◼ 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.
20
NVM Scheduling
◼ Use FCFS
◼ No disk heads or rotational latency but still room for optimization
◼ HHD vs NVM
◼ NVM best at random I/O, HDD at sequential
◼ Throughput can be similar
◼ Input/Output operations per second (IOPS) much higher with NVM (hundreds
of thousands vs hundreds)
21
- 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.
◼ The bootstrap is stored in ROM.
◼ Bootstrap loader program.
◼ Methods such as sector sparing used to handle bad blocks.
22
- 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.
◼ Operating system provides swap space management
◼ Secondary storage slower than RAM, so important to optimize performance
◼ Usually multiple swap spaces possible – decreasing I/O load on any given
device
◼ Best to have dedicated devices
◼ Can be in raw partition or a file within a file system
23
Chapter Outline
◼ Disk Structure
◼ Sector
◼ Track
◼ Cylinder
◼ Spindle
◼ Platter
◼ Arm
◼ head
◼ Disk Scheduling
◼ FCFS
◼ SCAN
◼ C-SCAN
◼ Disk Management
◼ Formatting
◼ Boot block
◼ Swap-Space
24