Presentation is loading. Please wait.

Presentation is loading. Please wait.

Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition Chapter 9: Mass-Storage Systems.

Similar presentations


Presentation on theme: "Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition Chapter 9: Mass-Storage Systems."— Presentation transcript:

1 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition Chapter 9: Mass-Storage Systems

2 9.2 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition Chapter 9: Mass-Storage Systems Overview of Mass Storage Structure Disk Structure Disk Scheduling Disk Management RAID Structure

3 9.3 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition Objectives Describe physical structure of secondary storage devices and its effects Explain performance characteristics of mass- storage devices Evaluate disk scheduling algorithms Discuss operating-system services provided for mass storage, including RAID

4 9.4 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition Overview of Mass Storage Structure Magnetic disks provide bulk of secondary storage Transfer rate – between drive and computer Positioning time (random-access time)  Seek time – time to move disk arm to cylinder  Rotational latency – time for sector to rotate under head  Head crash - disk head contacts disk surface (bad) Can be removable

5 9.5 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition Overview of Mass Storage Structure Disk drive attached to computer via I/O bus E.g., EIDE, ATA, SATA, USB, Fibre Channel, SCSI, SAS, Firewire Host controller in computer uses bus to talk to disk controller built into drive or storage array

6 9.6 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition Moving-head Disk Mechanism

7 9.7 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition Hard Disks Platters from.85” to 14” Commonly 3.5”, 2.5”, and 1.8” 30 GB to 3TB per drive Performance Transfer rate: ~1Gb/sec Seek time: ~10 ms Latency based on spindle speed  1 / (RPM / 60) = 60 / RPM Average latency = ½ latency (From Wikipedia)

8 9.8 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition Hard Disk Performance Average I/O time = average access time + (amount to transfer / transfer rate) + controller overhead E.g., transfer 4KB block on 7200 RPM disk with: 5ms average seek time 1Gb/sec transfer rate 0.1ms controller overhead 5ms + 4.17ms + 0.1ms + transfer time  Transfer time =... = 0.031 ms  Average I/O time = 9.301ms

9 9.9 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition Hard Disk Performance Average I/O time = average access time + (amount to transfer / transfer rate) + controller overhead

10 9.10 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition Hard Disk Performance E.g., transfer 4KB block on 7200 RPM disk with: 5ms average seek time 1Gb/sec transfer rate 0.1ms controller overhead Latency = 60 / 7200 / 2 =... = 4.17ms Transfer time = 4KB / 1GB/sec =... = 0.031 ms Average I/O time = 9.301ms = seek + latency + overhead + transfer = 5 + 4.17 + 0.1 + 0.031

11 9.11 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition The First Commercial Disk Drive 1956 IBM RAMDAC computer included the IBM Model 350 disk storage system 5M (7 bit) characters 50 x 24” platters Access time = < 1 second

12 9.12 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition Solid-State Disks Nonvolatile memory used like hard drive Many technology variations More reliable, faster More expensive, less capacity, shorter lifespan, busses can be bottleneck No moving parts no seek time no rotational latency

13 9.13 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition Magnetic Tape Early secondary-storage medium Evolved from open spools to cartridges Relatively permanent, holds large quantities Slow access time, (~1000X slower than disk) Used for backup, transfer between systems Wound or rewound past read-write head Once under head, transfer rates comparable to disk 140MB/sec and greater 200GB to 1.5TB typical

14 9.14 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition Chapter 9: Mass-Storage Systems Overview of Mass Storage Structure Disk Structure Disk Scheduling Disk Management RAID Structure

15 9.15 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition Disk Structure Disk drives addressed as large 1-dimensional arrays of logical blocks (smallest unit of transfer) Low-level formatting creates logical blocks media Logical blocks mapped (sequentially) into sectors of disk Sector 0: first sector, first track, outermost cylinder Logical to physical address should be easy  Except for bad sectors  Non-constant number of sectors per track because of constant angular velocity

16 9.16 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition Storage Array Can just attach disks, or arrays of disks Storage Array has controller(s), provides features to attached host(s) Ports to connect hosts to array Memory, controlling software Up to thousands of disks RAID, hot spares, hot swap Shared storage -> more efficiency

17 9.17 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition Storage Area Network Common in large storage environments Multiple hosts attached to multiple storage arrays

18 9.18 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition Network-Attached Storage Network-attached storage (NAS): storage made available over network rather than local connection (e.g., bus) Remotely attach to file systems NFS and CIFS are common protocols Implemented via remote procedure calls (RPCs) between host and storage Typically TCP or UDP on IP network

19 9.19 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition Network-Attached Storage

20 9.20 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition Chapter 9: Mass-Storage Systems Overview of Mass Storage Structure Disk Structure Disk Scheduling Disk Management RAID Structure

21 9.21 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition Disk Scheduling OS responsible for efficient use of HW Disk drives => fast access time, high disk bandwidth Goal: minimize seek time Seek time  seek distance Disk bandwidth : (total number of bytes transferred) (total time between first request and completion of last transfer)

22 9.22 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition Disk Scheduling (Cont.) Many sources of disk I/O requests: OS System processes User processes I/O request includes: Input or output mode Disk address Memory address Number of sectors to transfer

23 9.23 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition Disk Scheduling (Cont.) OS maintains queue of requests (per disk) Idle disk can immediately work on I/O request Busy disk means requests must queue Scheduling is only for when queue exists...

24 9.24 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition Disk Scheduling (Cont.) Drive controllers have small buffers and can manage queue of I/O requests (varying “depth”) Disk scheduling algorithms manage order of disk I/O requests E.g., request queue 98, 183, 37, 122, 14, 124, 65, 67 Disk head over 53

25 9.25 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition First Come First Serve (FCFS) Total head movement: 640 cylinders

26 9.26 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition SSTF Shortest Seek Time First Selects request with minimum seek time from current head position SSTF scheduling ≈ SJF scheduling May cause starvation

27 9.27 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition SSTF Total head movement: 236 cylinders

28 9.28 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition SCAN AKA elevator algorithm Disk arm starts at one end of disk Moves toward other end (servicing requests) Gets to other end of disk:  Head movement reversed  Servicing continues

29 9.29 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition SCAN (Cont.) Total head movement: 236 cylinders

30 9.30 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition C-SCAN C-SCAN: Circular SCAN More uniform wait time than SCAN Head moves from one end of disk to other, servicing requests as it goes When head reaches other end, however, it immediately returns to beginning of disk, without servicing any requests on return trip

31 9.31 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition C-SCAN (Cont.) Total head movement: 382 cylinders

32 9.32 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition C-LOOK LOOK – arm goes as far as final request in each direction (“look” before going) (not to end of disk) Reverses, services requests C-LOOK similar to C-SCAN “Circles” back

33 9.33 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition C-LOOK (Cont.) Total head movement: 322 cylinders

34 9.34 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition Selecting a Disk-Scheduling Algorithm SSTF is common, has natural appeal SCAN and C-SCAN better for systems with heavy disk usage Less starvation Performance depends on number & types of requests Requests for disk service can be influenced by file-allocation method And metadata layout

35 9.35 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition Selecting a Disk-Scheduling Algorithm Disk-scheduling algorithm should be written as separate module of OS Can be replaced with different algorithm (if necessary) Either SSTF or LOOK is reasonable choice for default algorithm What about rotational latency? Difficult for OS to calculate

36 9.36 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition Chapter 9: Mass-Storage Systems Overview of Mass Storage Structure Disk Structure Disk Scheduling Disk Management RAID Structure

37 9.37 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition Disk Management Low-level formatting, or physical formatting — Divide disk into sectors that disk controller can read / write Each sector holds header information, data, and error correction code (ECC) Usually 512 bytes of data

38 9.38 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition Disk Management To use disk to hold files, OS must record own data structures on disk Partition disk into one or more groups of cylinders, each treated as logical disk Logical formatting or “making a file system” To increase efficiency, most file systems group blocks into clusters  Disk I/O done in blocks  File I/O done in clusters

39 9.39 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition Disk Management Raw disk access – apps do their own block management, keep OS out of way E.g., databases Boot block initializes system Bootstrap stored in ROM Bootstrap loader program stored in boot blocks of boot partition

40 9.40 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition Chapter 9: Mass-Storage Systems Overview of Mass Storage Structure Disk Structure Disk Scheduling Disk Management RAID Structure

41 9.41 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition RAID Structure RAID – redundant array of inexpensive disks multiple disks provides reliability via redundancy Increases mean time to failure Mean time to repair – exposure time when another failure could cause data loss Mean time to data loss based on above factors

42 9.42 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition RAID (Cont.) Striping uses group of disks as one storage unit RAID is arranged into six different levels RAID schemes improve performance and reliability by storing redundant data Mirroring or shadowing (RAID 1) keeps duplicate of each disk Striped mirrors (RAID 1+0) or mirrored stripes (RAID 0+1) offers high performance and reliability Block interleaved parity (RAID 4, 5, 6) uses much less redundancy

43 9.43 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition RAID (Cont.) RAID within storage array can still fail if array fails Automatic replication of data between arrays is common A small number of hot-spare disks left unallocated Automatically replace failed disk

44 9.44 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition RAID 0 P = error-correcting “parity” bits C = second copy of data -Data striped between multiple disks -(no mirroring or parity)

45 9.45 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition RAID 1 P = error-correcting “parity” bits C = second copy of data -Disks mirrored (1-1)

46 9.46 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition RAID 2 P = error-correcting “parity” bits C = second copy of data -Error-correcting code striped across disks -Parity = 0 => even number of bits set in data -Parity = 1 => odd number of bits set in data -(Parity bits used for error checking)

47 9.47 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition RAID 3 P = error-correcting “parity” bits C = second copy of data -Byte-level striping between disks -Parity calculated across bytes -Parity stored on dedicated drive

48 9.48 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition RAID 4 P = error-correcting “parity” bits C = second copy of data -Block level striping between disks -Parity calculated for blocks, stored on independent disk

49 9.49 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition RAID 5 P = error-correcting “parity” bits C = second copy of data -Block-level striping -Distributed parity -Requires at least 3 disks -Fault tolerant with 1 failed disk

50 9.50 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition RAID 6 P = error-correcting “parity” bits C = second copy of data -Block-level striping -Double distributed parity bits -Requires at least 4 disks -Fault tolerant up to 2 failed disks!

51 9.51 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition RAID (0 + 1)

52 9.52 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition RAID (0 + 1) image from Wikipedia

53 9.53 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition RAID (1 + 0)

54 9.54 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition RAID (1 + 0) image from Wikipedia

55 9.55 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition Other Features Snapshot - view of file system before set of changes take place (i.e. at a point in time) Replication - automatic duplication of writes between separate sites For redundancy and disaster recovery Can be synchronous or asynchronous Hot spare disk - unused, automatically used by RAID production if disk fails Decreases mean time to repair


Download ppt "Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition Chapter 9: Mass-Storage Systems."

Similar presentations


Ads by Google