【正文】
(平均故障時(shí)間 ) ? Mean time to repair (平均修復(fù)時(shí)間 ) ? Mean time to data loss (平均數(shù)據(jù)丟失時(shí)間 ) Silberschatz, Galvin and Gagne ?2022 Operating System Concepts RAID (cont) ? Several improvements in diskuse techniques involve the use of multiple disks working cooperatively. ? Improvement of Reliability via Redundant 通過(guò)冗余提高可靠性 ? Reliability ? Redundancy ? Simplest (but most expensive) approach is to duplicate every disk, called mirroring (or shadowing) ? RAID schemes improve performance and improve the reliability of the storage system by storing redundant data. ? Mirroring or shadowing keeps duplicate of each disk. ? Block interleaved parity(塊交叉存取校驗(yàn)) uses much less redundancy. Silberschatz, Galvin and Gagne ?2022 Operating System Concepts RAID (cont) ? Improvement of Performance via Parallelism 通過(guò)并行性提高性能 ? With multiple disks, we can improve the transfer rate as well by striping data (bitlevel or blocklevel) across multiple disks ? Disk data striping uses a group of disks as one storage unit. ?Bitlevel striping: – . 4 disks, bits i and 4+i each byte go to disk i ?Blocklevel striping – . n disks, block i of a file goes to disk (i mod n)+1 ? Goals: ?Increase the throughput of multiple small accesses by load balancing ?Reduce the response time of large accesses Silberschatz, Galvin and Gagne ?2022 Operating System Concepts Fig RAID Levels ?P– errorcorrecting bits ?C– a second copy of the data Silberschatz, Galvin and Gagne ?2022 Operating System Concepts RAID Levels ? RAID Level 0: disk arrays with striping at the level of blocks, but without any redundancy ? RAID Level 1: disk mirroring ? RAID Level 2: memorystyle errorcorrecting code(ECC) anization ?All singlebit errors are detected by the memory system ?Errorcorrecting schemes store two or more extra bits ?Many extra disks, so it’s not used in practice Silberschatz, Galvin and Gagne ?2022 Operating System Concepts RAID Levels ? RAID Level 3: bitinterleaved parity (位交叉存取校驗(yàn)) anization ? 如果有某一個(gè)扇區(qū)壞了,可以確切地知道是哪一個(gè);并且可以通過(guò)另一磁盤上的相應(yīng)數(shù)據(jù)計(jì)算出該壞塊上的每一位是 0或是 1 ? 所需的冗余硬盤比 RAID Level 2少 ? 性能問(wèn)題:計(jì)算和寫(xiě)校驗(yàn)數(shù)據(jù)需要時(shí)間 ? 改進(jìn):使用 NVRAM( nonvolatile RAM) 或 Cache ? RAID Level 4: blockinterleaved parity (塊交叉存取校驗(yàn)) anization ? 與 RAID Level 3相類似 , 但在另一硬盤上保存了校驗(yàn)塊( not bit) ? Blocklevel striping ? 每個(gè)硬盤上按塊訪問(wèn),并行性比較好 ? 問(wèn)題:一次寫(xiě)操作,需要訪問(wèn)磁盤 4次( 2次讀老的塊 數(shù)據(jù)塊和校驗(yàn)塊 , 2次寫(xiě)新的塊) , 也即: readmodifywrite Silberschatz, Galvin and Gagne ?2022 Operating System Concepts RAID Levels ? RAID Level 5: blockinterleaved distributed parity (塊交叉分布式存取校驗(yàn)) ?與 RAID Level 4的區(qū)別:將數(shù)據(jù)和校驗(yàn)分布在所有 N+1個(gè)磁盤上,而不是將數(shù)據(jù)寫(xiě)在 N個(gè)盤上,將校驗(yàn)寫(xiě)在 1個(gè)盤上 ?例如:磁盤陣列有 5個(gè)硬盤構(gòu)成,則第 n個(gè)數(shù)據(jù)塊的校驗(yàn)信息存放在第 (n mod 5)+1個(gè)盤上,而第 n塊的實(shí)際數(shù)據(jù)分布在另外 4個(gè)磁盤上 ?改進(jìn):與 RAID Level 4相比,可以避免校驗(yàn)盤訪問(wèn)過(guò)頻 ? RAID Level 6: P+Q redundancy scheme ?與 RAID Level 5的相類似,但存放更多冗余信息,以防多個(gè)磁盤失效 ?使用 Errorcorrecting code,而不是 parity,因此需要更多的冗余信息 Silberschatz, Galvin and Gagne ?2022 Operating System Concepts Fig RAID (0 + 1) and (1 + 0) Silberschatz, Galvin and Gagne ?2022 Operating System Concepts RAID Levels ? RAID Level 0+1: a bination of RAID 0 and 1 ?RAID 0 提供性能 (performance) ?RAID 1 提供可靠性 (reliability) ?Better performance than RAID 5 ?A set of disks are striped, and then the stripe is mirrored to another, equivalent stripe ?RAID Level 1+0: disks are mirrored in pairs, and then the resulting mirror pairs are striped ?Have advantages over RAID 0+1 theoretically Silberschatz, Galvin and Gagne ?2022 Operating System Concepts RAID Levels ?RAID 1+0 have advantages over RAID 0+1 theoretically, for example: ?If a single disk fails in RAID 0+1, the entire stripe is inaccessible, leaving only the other stripe available ?With a failure in RAID 1+0, the single disk is unavailable, but its mirrored pair is still available as are all the rest of the disks Silberschatz, Galvin and Gagne ?2022 Operating System Concepts Selecting a RAID level ? RAID Level 0: used in highperformance applications ? RAID Level 1: used in highreliability with fast recovery ? RAID Level 0+1 and 1+0: used in highperformance and reliability with fast recovery ? RAID Level 5: preferred for storing large volumes of data ? Hot spare disk 熱備份磁盤 : is not used for data, but is configured to be used as a replacement should any other disk fail. ? Allocating more than one hot spare allows more than one failure to be repaired without human intervention Silberschatz, Galvin and Gagne ?2022 Operating System Concepts Extensions ? The concepts of RAID have generalized to other storage devices, including arrays of tapes and even to the broadcast of data over wireless systems ? Tapedrive robots Silberschatz, Galvin and Gagne ?2022 Operating System Concepts Disk Attachment 磁盤 連接 ? Disks may be attached one of two ways: attached via an I/O port IDE, ATA and SCSI 2. Network attached via a work connection Silberschatz, Galvin and Gagne ?2022 Operating System Concepts Fig NetworkAttached Storage Silberschatz, Galvin and Gagne ?2022 Operating System Concepts Fig StorageArea Network Silberschatz, Galvin and Gagne ?2022 Operating System Concepts SAN ? SAN is a private work using storage protocols rather than working protocols ? 當(dāng)前 SAN 系統(tǒng)普遍存在的缺陷: ? 協(xié)議不標(biāo)準(zhǔn) ? 設(shè)備的互操作性差 ? 發(fā)展趨勢(shì): ? 用 IP (Gigabit Ether) 網(wǎng)絡(luò)協(xié)議作為交換設(shè)備 Silberschatz, Galvin and Gagne ?2022 Operating System Concepts StableStorage Implementation 穩(wěn)定存儲(chǔ)實(shí)現(xiàn) ? Writeahead log scheme requires stable storage. 向前寫(xiě)日志系統(tǒng)需要穩(wěn)定存儲(chǔ)。 ? 交換是通過(guò) 在連續(xù)的磁盤區(qū)域和內(nèi)存之間 copy整個(gè)進(jìn)程 來(lái)實(shí)現(xiàn)的 ? Kernel uses swap maps to track swapspace use. OS核心使用交換映像跟蹤交換空間的使用情況。 ?Use algorithm optimized for speed, not for storage efficiency ?Add more swap space via repartitioning of the disk ? 有些操作系統(tǒng)(如 Solaris 2)比較靈活,既可利用 raw partitions,也可利用