Upload
taini
View
24
Download
0
Tags:
Embed Size (px)
DESCRIPTION
ITFN 2601 Introduction to Operating Systems. Lecture 21 Disk Access. Agenda. Disc Types Magnetic RAID Optical Read/Write Scheduling Error Handling Stable Read/Writes. Magnetic Disks. Cylinders Ring Number Heads Which Platter to Read Sectors Rotational Location. Disk Hardware. - PowerPoint PPT Presentation
Citation preview
ITFN 2601Introduction to Operating
Systems
Lecture 21
Disk Access
Agenda
Disc TypesMagneticRAIDOptical
Read/Write SchedulingError HandlingStable Read/Writes
Magnetic Disks
CylindersRing Number
HeadsWhich Platter to Read
SectorsRotational Location
Disk Hardware
RAID
Redundant Array of Inexpensive DisksAllows for the amalgamation of many drivesEliminates danger of a “Single Large
Expensive Disk”
Built-in error mechanismBuilt-in recovery mechanism
No Error/Recovery in RAID-0 and RAID-2
RAID Levels
6 LevelsRAID-0: Write-StripingRAID-1: Write-MirrorRAID-2: Byte-StripingRAID-3: Byte-Striping w/ParityRAID-4: Write-Striping w/ParityRAID-5: Write-Striping w/Parity-scattering
RAID 0
Each write is issued to a different driveLess wait for write-completionPrefers drives being equivalent
RAID 1
Writes are issued as in RAID 0
Writes are identically issued to backup-discsHighly size dependent
RAID 2
As RAID 0, except write is broken into bytesNormal writes are in block-sized chunks
Each byte is issued to a different drive
RAID 3
Writes are broken and issued as RAID 2One disc is “Parity”
XOR of the bytes being written on that passOne bit per byte
RAID 4
As RAID 0Each parity bit represents one strip
Parity will have n bits, where n is the number of drives (minus the parity drive)
RAID 5
Based on RAID 4If the Parity drive fails, all recovery data is lost!
Staggers Parity across drivesIf any drive is lost, it’s data is recovered from Parity
Optical Devices
Optical Disks (LaserDisc)30cm diameter
Compact DiscAudio [IS-10149; Red Book] (1980)Computer [CD-ROM; Yellow Book] (1984)
Physical Construction
Data is encoded in Pits/Lands
Pit – OnLand – Off
Red/Yellow Specifications
Symbols8bits->14bits, Encoding & Error Correction
Frames42 Symbols (24 data bytes; 18 ECC)
Sectors98 Frames
2048 data bytes288 ECC
CD-R/RW
Standard computer CD is “CD-ROM”Disc is extruded plastic
CD-Recordable [Orange Book] (1989)Disc has dye that is activated by light
CD-ReWritableDye has two states (transparent & opaque)Drive has three lasers
DVD
Digital Video Disc (or Versatile)Spiral is smallerPits/Lands are smaller“Smaller” laser
Holds up to 4.7G (vs 650M)4 types
Single/Double SidedSingle/Double Layered
Low Level Formatting
Performed by the manufacturer
Dictates the structure of the driveWrites each track with information about the
trackSkips over “bad” sectors
Disk Format
Moving the head is slowDisc would have to
spin backCylinder Skew
Transfer rate may be slowInterleaving sector #s
Disk Arm Scheduling
Rotation and Head movement are badFirst Come First ServeShortest Seek First
Identical to FIFO/SJF Process Scheduling
Elevator AlgorithmKeep moving in one directionTurn around at end of requests
Error Handling
Bad sectorsEach drive has n sectors per trackOnly m are available for use (m < n)The rest are “backup”If a sector has repeated read/write errors
Copy everything into the next backup sectorMark the original as “bad”
Stable Storage
If an error occurs during a write …Old data is goneNew data isn’t there
Stable storage ensures data integrityRelies on the fact that errors are
“uncommon”Like RAID 1
Stable Writes
Stable WritesWrite the data on main-disc
Repeat until the write is successful
Write the data on secondary-disc
Stable ReadsRead from the main-disc
Repeat some number of times
Read from secondary-disc (if unsuccessful)
Crash Recovery
Valid data always existsMay not have last write, but is not invalid
Usually acceptable