Disk Management
• Disk Structure
• Disk Scheduling
• RAID
• Disk Block Management
• Modern Secondary Storage Technologies
Disk Management
• Disk Structure
• Disk Scheduling
• RAID
• Disk Block Management
• Modern Secondary Storage Technologies
1
CPSC 410 / 611 : Operating Systems Disk Management
Disk Structure
sector
cylinder
track
Disk speed:
• seek time :
head moves to correct track
• rotational delay :
wait until sector is under head
• transfer time :
transfer data between disk and memory
Disk Performance
Seek Time : Ts
n = number of tracks traversed TS = m × n + s
m = “track traversal time”
s = startup time
b
Transfer Time: TT TT =
rN
b = # bytes to be transferred
N = number of bytes on track
2
CPSC 410 / 611 : Operating Systems Disk Management
Disk Management
• Disk Structure
• Disk Scheduling
• RAID
• Disk Block Management
• Modern Secondary Storage Technologies
Disk Scheduling
application application
kernel
file system
device
driver
disk queue
3
CPSC 410 / 611 : Operating Systems Disk Management
FCFS Scheduling
Request Sequence: 98, 183, 37, 122, 14, 124, 65, 67
0 24 49 74 99 124 149 174 199
Shortest-Seek-Time-First (SSTF)
Request Sequence: 98, 183, 37, 122, 14, 124, 65, 67
0 24 49 74 99 124 149 174 199
4
CPSC 410 / 611 : Operating Systems Disk Management
5
CPSC 410 / 611 : Operating Systems Disk Management
LOOK, C-LOOK
0 24 49 74 99 124 149 174 199
Disk Management
• Disk Structure
• Disk Scheduling
• RAID
• Disk Block Management
• Modern Secondary Storage Technologies
6
CPSC 410 / 611 : Operating Systems Disk Management
RAID
Observation: Traditional secondary storage devices are slow!
RAID
– Redundant Arrays of Independent Disks
– Redundant Arrays of Inexpensive Disks (Berkeley)
Common characteristics:
– Array of physical disks that are visible as single device to OS.
– Data is distributed across physical drives of array.
– Redundant disk capacity is used for error detection/correction.
RAID (cont)
Approach: Replace single large-capacity disk with array of smaller-
capacity disks.
Benefits:
– Improved I/O performance
– Enables incremental upgrade
Problems:
– Reliability: more devices increase the probability of failure.
-λ
R(t ) = P[t F > t ] e.g . R (t ) = e t
∞
Solution: redundancy
7
CPSC 410 / 611 : Operating Systems Disk Management
Raid (cont 2)
Raid
= Striping
+ Redundancy
block-level
bit-level
bit-level striping
blocks
block
block-level striping
RAID Level 0
“Block-level Striped Set without Parity”
blocks
block-level striping
8
CPSC 410 / 611 : Operating Systems Disk Management
RAID Level 1
• Problem:
– cost (100% redundancy)
mirrors
• Performance
– READs : good (with multithreading and
“split reads”)
– WRITEs: small performance penalty.
RAID Level 2
“Memory-Style
Error-Correcting Parity” block
9
CPSC 410 / 611 : Operating Systems Disk Management
RAID Level 3
“Bit-Interleaved Parity”
block
S0
S1
• Heads and spindles synchronized.
S2
• Small strips. S3
• Simple parity bits instead of ECC.
S4
e.g . P ( S ) = S 4 = S 3 ⊕ S 2 ⊕ S1 ⊕ S 0
parity
Disk 1 fails:
S1 = S 4 ⊕ S 3 ⊕ S 2 ⊕ S 0
RAID Level 4
10
CPSC 410 / 611 : Operating Systems Disk Management
RAID Level 5
RAID Level 6
11
CPSC 410 / 611 : Operating Systems Disk Management
Raid 1
Raid 0
blocks
Raid 1
block-level striping
Disk Management
• Disk Structure
• Disk Scheduling
• RAID
• Disk Block Management
• Modern Secondary Storage Technologies
12
CPSC 410 / 611 : Operating Systems Disk Management
Disk Formatting
• Bare disk:
• Physical formatting:
• “cut” into sectors
• identify sectors
• add space for error detection/correction
• Logical formatting:
• add blank directory, FAT, free space list, ...
Framing
• Character count • Starting and ending chars, with
character stuffing
character count
5 1 2 3 4 8 1 2 3 4 5 6 7 2 1
stuffed DLE
• Starting and ending flags, with bit • Physical layer coding violations
stuffing
Manchester
011011111011111011111010010
stuffed bits
lack of transition
13
CPSC 410 / 611 : Operating Systems Disk Management
• On-line management:
– Have the device driver map the bad block onto a good block
– Block X goes bad. Whenever OS requests block X, the disk
transparently accesses a replacement block Y.
– Problem: interferes with scheduling!
Disk Management
• Disk Structure
• Disk Scheduling
• RAID
• Disk Block Management
• Modern Secondary Storage Technologies
14
CPSC 410 / 611 : Operating Systems Disk Management
15
CPSC 410 / 611 : Operating Systems Disk Management
16
CPSC 410 / 611 : Operating Systems Disk Management
17
CPSC 410 / 611 : Operating Systems Disk Management
Optane (cont)
18