Presentation on theme: "CS 346 – April 4 Mass storage –Disk formatting –Managing swap space –RAID Commitment –Please finish chapter 12."— Presentation transcript:
CS 346 – April 4 Mass storage –Disk formatting –Managing swap space –RAID Commitment –Please finish chapter 12.
Disk mgmt Low-level (physical) formatting –Dividing disk medium into sectors –Besides data, sector contains error-correcting code –Later, disk controller will manipulate individual sectors High-level (logical) formatting –Record a data structure for file system on disk –Partition groups of cylinders if desired –Associate adjacent blocks into logical clusters to support file I/O Sector sparing: compensate for bad blocks! –Maintain list of bad blocks; replace each with a spare one Boot from disk: boot blocks in predefined locations contain system code to load boot partition of drive
Swap space Recall: used in virtual memory to store pages evicted from RAM –Faster to return to RAM than loading from file from scratch –In effect: disk space is now being used as extension of main memory, the very essence of VM Logically a separate partition of the disk from the file system When process started, its given some swap space Swap map: kernel data structure to track usage –Associate an counter value with each page in swap area –0 means that page is available to swap into –Positive number: number of processes using that swapped-out data (> 1 means its shared data)
RAID Increasingly practical to have several disks on a system –But increases probability & mean time to failure RAID = redundant array of independent disks –Redundancy: fault tolerance technique Six levels or strategies of RAID: use various combinations of fault tolerant techniques Typical RAID techniques in use –Striping a group of disks: split bits of each byte across disks Or block-level striping: split blocks of a file… –Mirroring another disk –Store parity (error-correcting) bits on another disk –Leaving some disks empty until needed to replace failed disk
RAID levels Various combinations of techniques… For example: RAID 0 – block striping; no mirroring or parity bits RAID 1 – add mirrored disks RAID 2, 3, 4 – extra disks store parity bits –If 1 disk fails, remaining bits of each byte and error-correction bit can be used to construct lot bit of each byte. –RAID 3 – bit-interleaved parity –RAID 4 – block-interleaved parity RAID 0+1 – a set of disks is striped, and then the stripe is mirrored to another disk RAID 1+0 – disks are mirrored into a pair of disks. This pair is then striped.
RAID extensions RAID is designed just to detect & handle disk failure Does not prevent/detect data corruption, etc. –Could be pointing to wrong file, wrong block Checksum for data and metadata on disk –Ex. For each disk block, how many bits are set? –Store with pointer to object (See Figure 12.13) –Detect whether it has changed. Grab correct data from the mirror. RAID also somewhat inflexible because its techniques require a certain number of disks. What to do?