Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

OS Secondary Storage Management: Disk Geometry, Interleaving, Scheduling, Error Handling -, Study notes of Operating Systems

This document from cs 333 at portland state university covers various aspects of secondary storage management in operating systems. Topics include disk geometry, sector interleaving, disk scheduling algorithms, and error handling. Concepts such as disk head, surfaces, tracks, sectors, cylinder, track, sector comparison, disk zones, virtual geometry, physical geometry, disk formatting, sector interleaving, seek time, rotational delay, actual transfer time, first-come first serve, shortest seek time first, scan, c-scan, look, c-look, shortest seek first, the elevator algorithm, transient errors, hard errors, manufacturing defects, dealing with bad sectors, stable storage, stable write, stable read, crash recovery, and raid. The document also discusses cds, cd-roms, cd-r, cd-rw, and dvds.

Typology: Study notes

Pre 2010

Uploaded on 08/18/2009

koofers-user-fq6
koofers-user-fq6 🇺🇸

5

(1)

10 documents

1 / 39

Toggle sidebar

Related documents


Partial preview of the text

Download OS Secondary Storage Management: Disk Geometry, Interleaving, Scheduling, Error Handling - and more Study notes Operating Systems in PDF only on Docsity! CS 333 Introduction to Operating Systems Class 16 – Secondary Storage Management Jonathan Walpole Computer Science Portland State University Disk geometry Disk head, surfaces, tracks, sectors … cylinder Track Sector Disk geometry Physical Geometry The actual layout of sectors on the disk may be complicated The controller does the translation The CPU sees a “virtual geometry”. Disk geometry virtual geometryphysical geometry (192 sectors in each view) Disk formatting A disk sector Typically 512 bytes / sector ECC = 16 bytes Sector interleaving No Interleaving Single Interleaving Double Interleaving Disk scheduling algorithms Time required to read or write a disk block determined by 3 factors Seek time Rotational delay Actual transfer time Seek time dominates Schedule disk heads to minimize it Disk scheduling algorithms First-come first serve Shortest seek time first Scan back and forth to ends of disk C-Scan only one direction Look back and forth to last request C-Look only one direction The elevator algorithm Use one bit to track which direction the arm is moving Up Down Keep moving in that direction Service the next pending request in that direction When there are no more requests in the current direction, reverse direction ~<—Time The elevator algorithm Initial position \ X X| [XIX X}| |X 0 5 10 15 20 25 Sequence of seeks 30 35 Cylinder Other disk scheduling algorithms First-come first serve Shortest seek time first Scan back and forth to ends of disk C-Scan only one direction Look back and forth to last request C-Look only one direction Handling bad sectors in the OS Add all bad sectors to a special file The file is hidden; not in the file system Users will never see the bad sectors • There is never an attempt to access the file Backups Some backup programs copy entire tracks at a time • Efficient Problem: • May try to copy every sector • Must be aware of bad sectors Stable storage The model of possible errors: Disk writes a block If there is an error during a write... • It will probably be detected upon reading the block Disk blocks can go bad spontaneously • But subsequent reads will detect the error CPU can fail (just stops) • Disk writes in progress are detectable errors Highly unlikely to loose the same block on two disks (on the same day) Stable storage Use two disks for redundancy Each write is done twice Each disk has N blocks. Each disk contains exactly the same data. To read the data ... you can read from either disk To perform a write ... you must update the same block on both disks If one disk goes bad ... You can recover from the other disk Stable storage Crash Recovery Scan both disks Compare corresponding blocks For each pair of blocks... If both are good and have same data... • Do nothing; go on to next pair of blocks If one is bad (failed ECC)... • Copy the block from the good disk If both are good, but contain different data... • (CPU must have crashed during a “Stable Write”) • Copy the data from disk #1 to disk #2 Crashes during a stable write ECC Disk error Disk Disk Disk Disk 1 2 Yi 2 y Y Old Old GY Old New, |Old New UY New| |New Stable storage Disk blocks can spontaneously decay Given enough time... The same block on both disks may go bad • Data could be lost! Must scan both disks to watch for bad blocks (e.g., every day) Many variants to improve performance Goal: avoid scanning entire disk after a crash. Goal: improve performance • Every stable write requires: 2 writes & 2 reads • Can do better... RAID a a) — Bit 1 Bit 2 Bit 3 Bit 4 Parity (¢) _— _— _— _— — a — a az Strip 0 Strip 1 Strip 2 Strip 3 PO-3 ps Pp — —_ _ Strip 4 Strip 5 Strip 6 Strip 7 (e) rp'4 | rip 5 | rp 6 | rip Z i) Strip 8 Strip 9 Strip 10 Strip 11 P8-11 Nc ice eee oT a) oO Strip 0 Strip 1 Strip 2 Strip 3 PO-3 _— _— _— Strip 4 Strip 5 Strip 6 P4-7 Strip 7 _ _— — — _— (f) Strip 8 Strip 9 P8-11 Strip 10 Strip 11 Strip 12] P12-15 Strip 13 Strip 14 Strip 15 Peete) Strip 16 Strip 17 Strip 18 Strip 19 RAID level 3 P4-7 RAID level 4 RAID level 5 CDs & CD-ROMs CD-ROMs 32x CD-ROM = 5,000,000 Bytes/Sec SCSI-2 is twice as fast. Updating write-once media VTOC = Volume Table of Contents When writing, an entire track is written at once. Each track has its own VTOC. Upon inserting a CD-R, Find the last track Obtain the most recent VTOC • This can refer to data in earlier tracks This tells which files are on the disk Each VTOC supercedes the previous VTOC Updating write-once media VTOC = Volume Table of Contents When writing, an entire track is written at once. Each track has its own VTOC. Upon inserting a CD-R, Find the last track Obtain the most recent VTOC • This can refer to data in earlier tracks This tells which files are on the disk Each VTOC supercedes the previous VTOC Deleting files? CD-RW Uses a special alloy Alloy has two states, with different reflectivities Crystalline (highly reflective) - Looks like “land” Amorphous (low reflectivity) - Looks like a “pit” Laser has 3 powers Low power: Sense the state without changing it High power: Change to amorphous state Medium power: Change to crystalline state
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved