Mass Storage Systems
Mass Storage Systems
CHAPTER 4
MASS-STORAGE SYSTEMS
1
OUTLINE
2
OVERVIEW OF MASS STORAGE STRUCTURE
4
MAGNETIC DISKS
5
DISK SECTOR
6
SOLID-STATE DISKS
9
MAGNETIC DISKS
12
DISK SCHEDULING (CONT.)
13
DISK SCHEDULING (CONT.)
14
1. FCFS SCHEDULING
15
2. SSTF SCHEDULING
Shortest Seek Time First (SSTF) selects the request with the
minimum seek time from the current head position
SSTF scheduling is a form of SJF scheduling; may cause starvation of
some requests
Illustration shows total head movement of 236 cylinders
16
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.
SCAN algorithm Sometimes called the elevator algorithm
But note that if requests are uniformly dense, largest density at other
end of disk and those wait the longest
17
3. SCAN SCHEDULING (CONT.)
18
4. C-SCAN SCHEDULING
19
4. C-SCAN SCHEDULING (CONT.)
20
5. LOOK, CLOOK SCHEDULING
21
SELECTING A DISK-SCHEDULING ALGORITHM
22
DISK MANAGEMENT
Before a disk can store data, it must be divided into sectors that the disk controller
can read and write. This process is called low Low-level formatting, or physical
formatting
Each sector can hold header information, plus data (Usually 512 bytes of data), plus error
correction code (ECC)
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, each treated as a logical disk
Logical formatting or “making a file system”:
OS stores the initial file-system data structures
Include maps of free and allocated space
Raw disk access for apps that want to do their own block
management, keep OS out of the way (databases for example)
Boot block initializes system
The bootstrap is stored in ROM
The problem is that changing this bootstrap code requires changing the ROM
hardware chips.
For this reason, 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
Disk that has a boot partition is called a boot disk or system disk.
24
BAD BLOCKS
Because disks have moving parts and small tolerances (recall that the disk head flies
just above the disk surface), they are prone to failure
More frequently, one or more sectors become defective. Most disks even come from
the factory with bad blocks
Depending on the disk and controller in use, these blocks are handled in a variety of
ways
One strategy is to scan the disk to find bad blocks while the disk is being formatted.
Any bad blocks that are discovered are flagged as unusable so that the file system
does not allocate them
A special program (such as the Linux badblocks command) must be run to search for
the bad blocks and to lock them away
Data that resided on the bad blocks usually are lost
25
SWAP-SPACE MANAGEMENT
26
RAID STRUCTURE
29
RAID 0
31
RAID 2
32
RAID 3
33
RAID 4
34
RAID 5
35
RAID 10
36