Multiple Disks I. Motivation: A. Reliability: Stave off data loss due to disk failure B. Performance: Write to multiple disks in parallel II. Reliability A. More disks: Lower mean time to failure 1. Adding disks increases the probability that one will fail B. Prevent n-disk failure from causing data loss 1. Write n+1 times 2. Assumes failures are independent a) Not necessarily true, ie, disks from same fabrication run will have the same defect 3. This is essentially just mirroring III. Performance A. Create a virtual disk of many individual disks B. Higher bandwidth reads C. Linear speedup in data you can read 1. Doesn't help seeks 2. Does help bandwidth D. Striping 1. Byte level: Stripe at byte granularity _____ _____ (_____) (_____) <-- (Disk drive) 1 |_ | 2 |_ | | | | | 3 |_ | 4 |_ | | | | | |_____| |_____| 2. Block level: Stripe at block granularity _____ _____ (_____) (_____) |__ | |__ | 1 |__| | 2 |__| | |__ | |__ | 3 |__| | 4 |__| | |_____| |_____| 3. Comparison between byte and block level striping a) Byte is better if accessing < 1 block, as a block-level wouldn't help much b) Block is better if > 1 block, because it can serve different requests at once 4. With striping, a failure in *any* disk means a failure in *all* disks IV. RAID: Redundant Array of Independent (old def: Inexpensive) Disks A. RAID Level ~= Configuration B. RAID 0: Basic Striping 1. Not reliable 2. Fast _____ _____ _____ (_____) (_____) (_____) d1 |_ | d2 |_ | d3 |_ | | | | | | | d4 |_ | d5 |_ | d6 |_ | | | | | | | |_____| |_____| |_____| C. RAID 1: Simple Mirroring 1. Increased reliability 2. No speedup _____ _____ (_____) (_____) |__ | |__ | d1 |__| | d1 |__| | |__ | |__ | d2 |__| | d2 |__| | |_____| |_____| D. RAID 2: Byte-Level Striping 1. Use (7, 4) Hamming Code 2. 4 disks worth of data requires 3 disks of parity data 3. 7 disks total 4. Can survive any 1 disk failure 5. 75% overhead. 6. Never used Data Disks: _____ _____ _____ _____ (_____) (_____) (_____) (_____) |__ | |__ | |__ | |__ | a1 |__| | a2 |__| | a3 |__| | a4 |__| | (byte1) |_____| |_____| |_____| |_____| Parity Disks: _____ _____ _____ (_____) (_____) (_____) |__ | |__ | |__ | ap |__| | aq |__| | ar |__| | |_____| |_____| |_____| E. RAID 3: Byte Level Striping with Parity 1. One extra disk for parity 2. Intuition: The disk controller tells you when you read a disk sector if it is invalid. So if a disk fails, you know which disk it is that failed. 3. Simple example: Assume each disk holds one bit: ___ ___ ___ ___ ___ | | | | | | | | | | | A1| | A2| | A3| ... |A10| | Ap| <-- Parity |___| |___| |___| |___| |___| Holds: 1 0 1 0 1 <-- Parity If we know that it was A2 that failed, then we can reconstruct the contents of A2 Extrapolate example to a whole disk containing parity for each corresponding byte. 4. Low overhead, fast 5. Slower than RAID 1 because it has to calculate parity at each write F. RAID 4: Same as RAID 3 but with block level striping 1. Advantages: a) Better than RAID 3 because can serve requests in parallel b) One disk is involved in each access 2. Disadvantages: a) If a write is smaller than a block, still have to recalculate a whole parity block b) Parity disk is accessed at every access - Parity disk will wear out faster - Bottleneck waiting for parity disk G. RAID 5: Spread data across multiple disks 1. Block level striping 2. Distributed parity blocks 3. Only supports a single disk failure a) Window of vulnerability - Manually replace disk - Rebuild new disk - If a second failure occurs during Window of Vulnerability, we lose everything - Research shows that rebuild process can actually cause another disk to fail! _____ _____ _____ (_____) (_____) (_____) |__ | |__ | |__ | a1 |__| | a2 |__| | ap |__| | |__ | |__ | |__ | b1 |__| | bp |__| | b2 |__| | |__ | |__ | |__ | cp |__| | c1 |__| | c2 |__| | |_____| |_____| |_____| H. RAID 6: RAID 5 with Two "Parity" disks 1. Call them Ap and Aq - Reed-Solomon codes 2. Parity disks store different data 3. Two disk failures do not cause data loss I. RAID 1+0: Mirrored and Striped J. Hot Spare A. Helps with Window of Vulnerability problem B. Keep a spare disk live and connected, but don't use it to store data C. Window decreased because do not need to manually add a disk D. Auto-start rebuild process on failure K. Scalability A. Ease of scalability depends on RAID configuration B. Something to consider when designing a RAID setup