0% found this document useful (0 votes)
51 views18 pages

Disk Scheduling RAID Edited Version

1. A hard drive contains multiple platters that spin and read/write heads that can access different tracks on each platter. 2. RAID (Redundant Array of Inexpensive Disks) uses multiple disks to create one large, faster, and more reliable virtual disk. 3. RAID levels like RAID 0, 1, 4, 5, and 6 distribute data across disks for performance and redundancy using techniques like striping, mirroring, and parity.

Uploaded by

Samia Rahman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views18 pages

Disk Scheduling RAID Edited Version

1. A hard drive contains multiple platters that spin and read/write heads that can access different tracks on each platter. 2. RAID (Redundant Array of Inexpensive Disks) uses multiple disks to create one large, faster, and more reliable virtual disk. 3. RAID levels like RAID 0, 1, 4, 5, and 6 distribute data across disks for performance and redundancy using techniques like striping, mirroring, and parity.

Uploaded by

Samia Rahman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

A Multi-Platter Disk

1
Addressing and Geometry
• Externally, hard drives expose a large number of sectors
(blocks)
– Typically 512 or 4096 bytes
– Individual sector writes are atomic
– Multiple sectors writes may be interrupted (torn write)
• Drive geometry
– Sectors arranged into tracks
– A cylinder is a particular track on multiple platters
– Tracks arranged in concentric circles on platters
– A disk may have multiple, double-sided platters
• Drive motor spins the platters at a constant rate
– Measured in revolutions per minute (RPM)
2
Geometry Example
Sector Three tracks

12
11 13
23 24 25
10 14
32
9 22 31 33 26 15
Rotation

8 21 30 34 27 0 Read head
7 20 29 35 16 1
28 Seeks across the
6 19
18
17 2 various tracks
5 3
4

Outer tracks hold


One platter
more data 3
Redundant Array of Inexpensive Disks
• RAID: use multiple disks to create the illusion of a
large, faster, more reliable disk
• Externally, RAID looks like a single disk
– i.e. RAID is transparent
– Data blocks are read/written as usual
– No need for software to explicitly manage multiple disks or
perform error checking/recovery
• Internally, RAID is a complex computer system
– Disks managed by a dedicated CPU + software
– RAM and non-volatile memory
– Many different configuration options (RAID levels)

4
RAID 0: Striping
• Key idea: present an array of disks as a single large disk
• Maximize parallelism by striping data cross all N disks

Dis Dis Dis Dis


Data block = k0 k1 k2 k3
Sequential 0 1 2 3 Random accesses
512 bytes
accesses 4 5 6 7 are naturally
spread across spread over all
8 9 10 11 Stripe
drives
all drives
12 13 14 15

5
Addressing Blocks
• How do you access specific data blocks?
– Disk = logical_block_number % number_of_disks
– Offset = logical_block_number / number_of_disks
• Example: read block 11
– 11 % 4 = Disk 3
– 11 / 4 = Physical Block 2 (starting from 0)
Dis Dis Dis Dis
k0 k1 k2 k3
0 1 2 3
4 5 6 7
8 9 10 11
12 13 14 15 6
Analysis of RAID 0
• Capacity: N
– All space on all drives can be filled with data
• Reliability: 0
– If any drive fails, data is permanently lost
• Sequential read and write: N * S
– Full parallelization across drives
• Random read and write: N * R
– Full parallelization across all drives

7
RAID 1: Mirroring
• RAID 0 offers high performance, but zero error
recovery
• Key idea: make two copies of all data

Dis Dis
k0 k1
0 0
1 1
2 2
3 3

8
Di Di Di Di Analysis of RAID 1 (1)
sk sk sk sk
0
0 1
1 0
2 1
3
2 3 2 3 Di Di Di Di
4 5 4 5 sk sk sk sk
6 7 6 7 0
0 1
1 0
2 1
3
Each skipped 2 3 2 3
block is 4 5 4 5
wasted 6 7 6 7

• Capacity: N / 2 • Sequential write: (N / 2) * S


– Two copies of all data, thus half – Two copies of all data, thus
capacity half throughput
• Reliability: 1 drive can fail, • Sequential read: (N / 2) * S
sometime more – Half of the read blocks are
wasted, thus halving
– If you are lucky, N / 2 drives can fail throughput
without data loss
9
Analysis of RAID 1 (2)
• Random read: N * R
– Best case scenario for RAID 1
– Reads can parallelize across all disks
• Random write: (N / 2) * R
– Two copies of all data, thus half throughput

Di Di Di Di
sk sk sk sk
0
0 1
1 0
2 1
3
2 3 2 3
4 5 4 5
6 7 6 7
10
RAID 0+1 and 1+0 Examples
0+1 1+0
Mirror Stripe

Stripe Stripe Mirror Mirror


Di Di Di Di Di Di Di Di
sk sk sk sk sk sk sk sk
0
0 1
1 0
2 1
3 0
0 0
1 1
2 31
2 3 2 3 2 2 3 3
4 5 4 5 4 4 5 5
6 7 6 7 6 6 7 7

• Combines striping and mirroring


• Superseded by RAID 4, 5, and 6 11
RAID 4: Parity Drive
Dis Dis Dis Dis Disk 4
k0 k1 k2 k3 Disk N only stores
0 1 2 3 P0
4 5 6 7 P1 parity information
8 9 10 11 P2 for the other N-1
12 13 14 15 P3 disks

Disk 0 Disk 1 Disk 2 Disk 3 Disk 4


0 0 1 1 0^0^1^1=0 Parity
0 1 0 0 0^1^0^0=1 calculated
1 1 1 1 1^1^1^1=0 using XOR
0 1 1 1 0^1^1^1=1

12
Analysis of RAID 4
• Capacity: N – 1
– Space on the parity drive is lost
• Reliability: 1 drive can fail
• Sequential Read and write: (N – 1) * S
– Parallelization across all non-parity blocks
• Random Read: (N – 1) * R
– Reads parallelize over all but the parity drive
• Random Write: R / 2
– Writes serialize due to the parity drive
– Each write requires 1 read and 1 write of the parity drive, thus
R/2
13
RAID 5: Rotating Parity

Dis Dis Dis Dis


k0 k1 k2 k3
0 1 2 3 Parity blocks are
5 6 7 P1 spread over all N
10 11 P2 8 disks
15 P3 12 13

Disk 0 Disk 1 Disk 2 Disk 3 Disk 4


0 0 1 1 0^0^1^1=0
1 0 0 0^1^0^0=1 0
1 1 1^1^1^1=0 1 1
1 0^1^1^1=1 0 1 1
14
Analysis of Raid 5
• Capacity: N – 1 [same as RAID 4]
• Reliability: 1 drive can fail [same as RAID 4]
• Sequential Read and write: (N – 1) * S [same]
– Parallelization across all non-parity blocks
• Random Read: N * R [vs. (N – 1) * R]
– Unlike RAID 4, reads parallelize over all drives
• Random Write: N / 4 * R [vs. R / 2 for RAID 4]
– Unlike RAID 4, writes parallelize over all drives
– Each write requires 2 reads and 2 write, hence N / 4

15
Comparison of RAID Levels

• N – number of drives • R – random access speed


• S – sequential access speed • D – latency to access a single disk

16
RAID 6
Dis Dis Dis Dis
k0 k1 k2 k3
0 1 2 P00 Two parity blocks
4 5 P10 P11 per stripe
8 P20 P21 6
P30 P31 9 10

• Any two drives can fail


• N – 2 usable capacity
• No overhead on read, significant overhead on write
• Typically implemented using Reed-Solomon codes
17
Choosing a RAID Level
• Best performance and most capacity?
– RAID 0
• Greatest error recovery?
– RAID 1 (1+0 or 0+1) or RAID 6
• Balance between space, performance, and
recoverability?
– RAID 5

18

You might also like