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

Slides:



Advertisements
Similar presentations
Overview of Mass Storage Structure
Advertisements

Disk Scheduling Based on the slides supporting the text 1.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Mass-Storage Systems Revised Tao Yang.
Chapter 12: Mass-Storage Structures
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 12: Mass-Storage Systems.
Based on the slides supporting the text
Chapter 12: Secondary-Storage Structure Silberschatz, Galvin and Gagne ©2005 Operating System Principles 12.1 Overview of Mass Storage Structure.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 12: Mass-Storage Systems.
1 Disk Scheduling Chapter 14 Based on the slides supporting the text.
Disks CS 416: Operating Systems Design, Spring 2001 Department of Computer Science Rutgers University
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Mass-Storage Systems Revised Tao Yang.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 12: Mass-Storage Systems.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 12: Mass-Storage Systems.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 12: Mass-Storage Systems.
12.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Chapter 12: Mass-Storage Systems.
Disk and I/O Management
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 14: Mass-Storage Systems Disk Structure Disk Scheduling Disk Management Swap-Space.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 10: Mass-Storage Systems Modified.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 10: Mass-Storage Systems.
CS307 Operating Systems Mass-Storage Systems Fan Wu Department of Computer Science and Engineering Shanghai Jiao Tong University Fall 2011.
Mass-Storage Systems. Objectives  physical structure of secondary and tertiary storage devices  performance characteristics of mass-storage devices.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 12: Mass-Storage Systems.
Disk Structure Disk drives are addressed as large one- dimensional arrays of logical blocks, where the logical block is the smallest unit of transfer.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 13+14: I/O Systems and Mass- Storage Structure I/O Hardware Application I/O.
Chapter 12: Mass-Storage Systems Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 12: Mass-Storage Systems Overview of Mass.
Page 110/12/2015 CSE 30341: Operating Systems Principles Network-Attached Storage  Network-attached storage (NAS) is storage made available over a network.
CS307 Operating Systems Mass-Storage Systems Fan Wu Department of Computer Science and Engineering Shanghai Jiao Tong University Spring 2012.
Chapter 12: Mass-Storage Systems Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 1, 2005 Chapter 12: Mass-Storage.
CE Operating Systems Lecture 20 Disk I/O. Overview of lecture In this lecture we will look at: Disk Structure Disk Scheduling Disk Management Swap-Space.
I/O Management and Disk Structure Introduction to Operating Systems: Module 14.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 14: Mass-Storage Systems Disk Structure Disk Scheduling Disk Management Swap-Space.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition Chapter 9: Mass-Storage Systems.
1.  Disk Structure Disk Structure  Disk Scheduling Disk Scheduling  FCFS FCFS  SSTF SSTF  SCAN SCAN  C-SCAN C-SCAN  C-LOOK C-LOOK  Selecting a.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 12: Mass-Storage Systems.
CSE Operating System Principles Mass Storage.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 10: Mass-Storage Systems.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 10: Mass-Storage Systems.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 10: Mass-Storage Systems.
Operating System Concepts with Java – 7 th Edition, Nov 15, 2006 Silberschatz, Galvin and Gagne ©2007 Chapter 11: File System Implementation.
Unit V part 2.
Chapter 10: Mass-Storage Systems
Chapter 10: Mass-Storage Systems
Chapter 12: Mass-Storage Systems
Operating System (013022) Dr. H. Iwidat
Chapter 10: Mass-Storage Systems
Chapter 12: Mass-Storage Structure
Operating System I/O System Monday, August 11, 2008.
Disk Scheduling Algorithms
Mass-Storage Structure
Chapter 10: Mass-Storage Systems
Chapter 14 Based on the slides supporting the text
Chapter 12: Mass-Storage Systems
Chapter 10: Mass-Storage Systems
Chapter 10: Mass-Storage Systems
Overview Continuation from Monday (File system implementation)
Mass-Storage Systems.
Chapter 10: Mass-Storage Systems
Chapter 10: Mass-Storage Systems
Chapter 10: Mass-Storage Systems
Chapter 10: Mass-Storage Systems
Chapter 10: Mass-Storage Systems
Chapter 9: Mass-Storage Systems
Chapter 10: Mass-Storage Systems
Chapter 10: Mass-Storage Systems
Disk Scheduling The operating system is responsible for using hardware efficiently — for the disk drives, this means having a fast access time and disk.
Chapter 11: Mass-Storage Systems
Mass-Storage Systems.
Chapter 10: Mass-Storage Systems
Chapter 10: Mass-Storage Systems
Mass-Storage Systems (Disk Scheduling)
Presentation transcript:

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

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

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

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

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

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

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)

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 ms + 0.1ms + transfer time  Transfer time =... = ms  Average I/O time = 9.301ms

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

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 =... = ms Average I/O time = 9.301ms = seek + latency + overhead + transfer =

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

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

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

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

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

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

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

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

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

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

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)

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

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...

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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)

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)

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)

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

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

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

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!

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

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

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

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

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