Chapter 12: Mass-Storage Systems

Slides:



Advertisements
Similar presentations
Overview of Mass Storage Structure
Advertisements

Silberschatz, Galvin and Gagne Operating System Concepts Disk Scheduling Disk IO requests are for blocks, by number Block requests come in an.
Disk Scheduling Based on the slides supporting the text 1.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Disks and RAID.
OPERATING SYSTEMS CS3530 Summer 2014 OPERATING SYSTEMS CS3530 Summer 2014 Input/Output System Chapter 9.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 14: Mass-Storage Systems  Disk Structure  Disk Scheduling  Disk Management.
14.1 Silberschatz, Galvin and Gagne ©2003 Operating System Concepts with Java Chapter 14: Mass-Storage Systems Disk Structure Disk Scheduling Disk Management.
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.
Disks.
1 Disk Scheduling Chapter 14 Based on the slides supporting the text.
12: IO Systems1 I/O SYSTEMS This Chapter is About Processor I/O Interfaces: Connections exist between processors, memory, and IO devices. The OS must manage.
Disks CS 416: Operating Systems Design, Spring 2001 Department of Computer Science Rutgers University
04/21/2004CSCI 315 Operating Systems Design1 Disk Scheduling.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Mass-Storage Systems Revised Tao Yang.
CPSC 231 Secondary storage (D.H.)1 Learning Objectives Understanding disk organization. Sectors, clusters and extents. Fragmentation. Disk access time.
Secondary Storage Management Hank Levy. 8/7/20152 Secondary Storage • Secondary Storage is usually: –anything outside of “primary memory” –storage that.
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.
Moving-head Disk Mechanism Rotation Speeds: 60 to 200 rotations per second Head Crash: read-write head makes contact with the surface.
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.
Operating Systems CMPSC 473 I/O Management (4) December 09, Lecture 25 Instructor: Bhuvan Urgaonkar.
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.
Silberschatz and Galvin  Operating System Concepts Module 13: Secondary-Storage Disk Structure Disk Scheduling Disk Management Swap-Space Management.
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.
Chapter 12: Mass-Storage Systems Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 1, 2005 Chapter 12: Mass-Storage.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 14: Mass-Storage Systems Disk Structure Disk Scheduling Disk Management Swap-Space.
CS 6502 Operating Systems Dr. J.. Garrido Device Management (Lecture 7b) CS5002 Operating Systems Dr. Jose M. Garrido.
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.
Disks Chapter 5 Thursday, April 5, Today’s Schedule Input/Output – Disks (Chapter 5.4)  Magnetic vs. Optical Disks  RAID levels and functions.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 14: Mass-Storage Systems Disk Structure Disk Scheduling Disk Management Swap-Space.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 14: Mass-Storage Systems Disk Structure Disk Scheduling Disk Management Swap-Space.
Silberschatz, Galvin and Gagne ©2009 Edited by Khoury, 2015 Operating System Concepts – 9 th Edition, Chapter 10: Mass-Storage Structure.
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.
Operating Systems (CS 340 D) Princess Nora University Faculty of Computer & Information Systems Computer science Department.
Silberschatz, Galvin, and Gagne  Applied Operating System Concepts Module 13: Secondary-Storage Disk Structure Disk Scheduling Disk Management.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 13 Mass-Storage Systems Slide 1 Chapter 13 Mass-Storage Systems.
Chapter 14: Mass-Storage
Chapter 14: Mass-Storage Systems Disk Structure. Disk Scheduling. RAID.
Chapter 9 I/O System. 2 Input/Output System I/O Major objectives are: Take an application I/O request and send it to the physical device. Then, take whatever.
Disk Scheduling The operating system is responsible for using hardware efficiently — for the disk drives, this means having a fast access time and disk.
1 Chapter 13 Mass-Storage Structure. 2 Disk Structure Disk drives are addressed as large 1- dimensional arrays of logical blocks, where the logical block.
M ASS S TORAGE S TRUCTURES Lecture: Operating System Concepts Lecturer: Pooja Sharma Computer Science Department, Punjabi University, Patiala.
Presentation-4 Group-A1 Professor Mohamed Khalil Anita Kanuganti Hemanth Rao.
CPSC 231 Secondary storage (D.H.)1 Learning Objectives Understanding disk organization. Sectors, clusters and extents. Fragmentation. Disk access time.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition Chapter 9: 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.
Chapter 10: Mass-Storage Systems
Operating System (013022) Dr. H. Iwidat
Chapter 12: Mass-Storage Structure
Operating System I/O System Monday, August 11, 2008.
Mass-Storage Structure
DISK SCHEDULING FCFS SSTF SCAN/ELEVATOR C-SCAN C-LOOK.
Lecture 45 Syed Mansoor Sarwar
Chapter 14 Based on the slides supporting the text
Chapter 12: Mass-Storage Systems
Overview Continuation from Monday (File system implementation)
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.
Presentation transcript:

Chapter 12: Mass-Storage Systems (Storage Management-Secondary storage)

Chapter 12: Mass-Storage Systems Disk Structure Disk Scheduling Disk Management Swap-Space Management RAID Structure Disk Attachment Stable-Storage Implementation Tertiary Storage Devices

Introduction Secondary storage devices provide non-volatile, permanent mass storage capabilities. They come in a variety of types including hard disks, floppy disks, CDs,DVDs,magnetic tapes, pen-drives, etc. The most common used device for storing very large information permanently is the Hard disk or simple called Disk.

Disk Structure There is two types of Disk structure. Physical Structure Logical Structure.

Physical Geometry of a Disk

Physical structure Previous slid figure depicts the physical geometry of a hard disk. A hard disk is a sealed unit. It contains one or more circular platters. Each platters contains magnetic coating on both of its surfaces. They rotate together round a central spindle. Rotation speed is normally 3600,5400 or 7200 rpm (Rotation per Minute). Normally disks contain 1 to 8 platters. Each platter contains two surfaces (one above and other below)

Physical structure Data is read from and written to these platters using a number of read/write heads. Normally there are as many heads as surfaces in disk. Each of these heads is attached to an arm. An arm can be moved in order to access different parts of the platter. A platter can be thought of as a collection of circular, concentric, flat rings. This rings are called tracks. Data is stored on the surface of a platter inside these tracks in form of bits (0 or 1).

Physical structure Normally there are more than thousands of tracks on a single surface. Each track is divided into a fixed size blocks, called sectors. Normally each sector is of 512 bytes and there are hundreds of sectors on a single track. Sectors a smallest physical storage unit on a disk. Read and write operations are performed in number of sectors on disk. Group of tracks with the same radius are called cylinders.

Physical structure Here, each track is on a different platter. And each track can be accesses without moving the read/write head of a disk. Number of cylinders are same as that of tracks.

Logical structure Here, disk is considered as a large one dimensional array of fixed size logical blocks. Size can be varied from system to system. Normally, the size will be of 512 bytes. These blocks are numbered to identify them uniquely on a disk. Numbering starts from ‘0’ or ‘1’ to some maximum. Total number of blocks depends upon a storage capacity of a disk and the size of a block.

Logical structure The OS considers disk in this form as depicted in bellow figure. Here, blocks are considered as the smallest unit of data transfer between disk and main memory. Whenever any file storage space it is allocated one or more blocks either contiguously or non-contiguously as per the allocation method. 1 2 … N-1

Logical structure Whenever there is a need to access any information from disk, OS system specifies a logical block number. This logical block number is mapped to a physical cylinder number, head number and sectors number.

Constant Linear velocity v/s Constant Angular velocity As read/write head moves from inner track to outer track, track length increases. Due to this reason, outer tracks can hold more sectors compared to inner tracks. Another factor is as head moves towards outer tracks, the rate of data moving under this head also increases. These two factors affect the amount of data that can be accessed in particular time duration.

Constant Linear velocity v/s Constant Angular velocity In other words, data rate varies over different tracks. But to keep disk operations simple, data rate should be constant. To over come this problem, there are two Methods which provide constant data rate. Constant Linear velocity Constant Angular velocity

Constant Linear Velocity (CLV) Here, density of bits per track is kept uniform. So outer tracks hold more amounts of data compared to inner tracks. To keep data rate constant, this method increases disk rotation speed as read/write head moves from outer track to inner track. This method is known as constant linear velocity (CLV). It is used in CD-ROMs and DVDs.

Constant Angular velocity Here, the disk rotation speed is kept constant. But density of bits per track is not uniform. To keep data rate constant this method decreases density of bits from inner track to outer track. So, outer tracks hold same amount of data as inner tracks. This methods is known as constant angular velocity (CAV). It is used in hard disks.

Disk Scheduling Whenever any process needs to perform I/O operation to or from the disk, it requests OS to provide service. System calls are used for this purpose. The request consists of the following information : Whether operation is read (input) operation or write (output) operation The disk address for data transfer The memory address for data transfer and The amount of data to be transferred.

Disk Scheduling if the disk and disk controller are free, request will be served immediately. Else, the request will be placed in the device queue. When current request completes, one of the pending requests is selected to be served by a Operating System. Disk scheduling is the process of making choice of which pending read/write request to serve next when the current request completes. The primary goal of disk scheduling is to serve all I/O (read/write) requests efficiently.

Disk Scheduling The total time required to complete any read or write operation depends upon the following three factors: Seek time : time required to move the read/write head to the proper cylinder. Rotation Latency (Delay): this required for the proper sector to rotate under the head. Actual time to transfer data. Here, seek time dominates the other two times. Because of this, reducing the average seek time improves the performance considerably.

Disk Scheduling Algorithms These algorithms are used to select one of the pending I/O request when the currently request completes. There are mainly six disk scheduling algorithms available as given below: FCFS (First Come First Serve) Scheduling SSTF (Shortest Seek Time First) Scheduling SCAN Scheduling LOOK Scheduling C-SCAN Scheduling C-LOOK Scheduling

FCFS (First Come First Serve) Scheduling Selection Criteria : Serves the requests in the same order as they are received. The request which came first, will be served first. Order of pending requests : We illustrate them with a request queue (0-99). 98, 183, 37, 122, 14, 124, 65, 67 Head pointer 53

FCFS Order in which requests will be served : 98, 183, 37, 122, 14, 124, 65, 67 Total head movement: (98-53)+(183-98)+(183-37)+(122-37) +(122-14)+(124-14)+(124-65)+(67-65) 45+85+146+85+108+110+59+2=640 cylinders

Illustration shows total head movement of 640 cylinders. FCFS Illustration shows total head movement of 640 cylinders.

FCFS Advantages : Simple, Fair to all request Disadvantages : Not Efficient, because the average seek time is very high.

SSTF (Shortest Seek Time First) Scheduling Selection Criteria : Serve the request which involves minimum seek time from the current position of the read/write head. So the request for cylinder number, which is closest to the current head position, will be served first. Order of pending requests : We illustrate them with a request queue (0-99). 98, 183, 37, 122, 14, 124, 65, 67 Head pointer 53

SSTF Order in which requests will be served : 53,65,67,37,14,98,122,124,183 Total head movement: (65-53)+(67-65)+(67-37)+(37-14) +(98-14)+(122-98)+(124-122)+(183-124) 12+2+30+23+84+24+2+59=236 cylinders

SSTF

SSTF Advantages : More efficient than FCFS algorithm Disadvantages : Starvation is possible for request involving longer seek time.

SCAN Scheduling Selection Criteria : Keep scanning between two end points of disk continuously. Serve the requests encountered on the way. This algorithm is also known as an Elevator algorithm Here, the disk arm (or head) starts at one end of the disk and moves toward the other end. It serves all the request coming in the way. After reaching other end, the direction of head movement is reversed and servicing continuous.

SCAN Scheduling Order of pending requests : We illustrate them with a request queue (0-99). 98, 183, 37, 122, 14, 124, 65, 67 Head pointer 53

SCAN Scheduling Order in which requests will be served : 53,37,14,0,65,67,98,122,124,183 Total head movement: (53-37)+(37-14)+(14-0)+(65-0)+(67-65) +(98-67)+(122-98)+(124-122)+(183-124) 16+23+14+65+2+31+24+22+59=236cylinders

SCAN Scheduling

SCAN Scheduling Advantages : More efficient than FCFS algorithm Also there is no starvation for any requests. Disadvantages : Requires extra head movement between two extreme points. For example, after servicing 14th cylinder there is no need to visit 0th cylinder. But though this algorithm visits the end points. Not so fair, cylinders which are just behind the head will wait longer.

LOOK Scheduling Selection Criteria : Keep scanning between two end points continuously. Serve the requests encountered on the way. But go only as far as the final requests in each direction. This algorithm is same as that of SCAN but the difference is that here extreme points are not visited unnecessarily. Order of pending requests : We illustrate them with a request queue (0-99). 55,90,15,60,5,65,30 Head pointer 25

LOOK Scheduling Order in which requests will be served : 25,15,5,30,55,60,65,90 Total head movement: 10+10+25+25+5+5+25=105 cylinder

LOOK Scheduling 25 15 30 55 60 65 90 99 5

LOOK Scheduling Advantages : More efficient than FCFS algorithm There is no starvation for any requests. Also there is no extra head movement in visiting two extreme points unnecessarily. Disadvantages : Not so fair, cylinders which are just behind the head will wait longer.

C-SCAN (circular-SCAN) Scheduling Selection Criteria: Keep scanning from start to end of disk continuously. Serve the requests encountered on the way. This algorithm is same as SCAN algorithm, but it serves in one direction only. After reaching to end of the disk, it immediately returns to the beginning of the disk, without servicing any requests on the return trip.

C-SCAN (Cont.)

C-LOOK (circular-LOOK) Scheduling Keep scanning from start to end of disk continuously. Serve the request encountered on the way. But go only as far as the final request in that direction. This algorithm is same as LOOK algorithm, but it serves in one direction only. After reaching to final request, it immediately returns to the first request which is nearer to the beginning of the disk, without servicing any requests on the return trip.

C-LOOK (Cont.)

Selecting Disk Scheduling Algorithms There are various scheduling algorithms available. But now question is : which algorithm should be selected for actual use? Here, some factors are given which affect the performance of a disk scheduling algorithm.

Selecting Disk Scheduling Algorithms These factors are given as below : 1. Number and type of requests: Performance of a disk scheduling algorithm heavily depends upon the number and type of requests. For example, if the device queue contains only one request, then all algorithms will behave the same. Because here, only one choice is available, all algorithms will behave like as FCFS algorithm.

Selecting Disk Scheduling Algorithms 2. File allocation method: File allocation method also has good contribution in deciding performance. For example, when a contiguously allocated file is accessed, the disk requests are normally close to each other. While for a linked or indexed file, disk blocks are scattered over disk, and disk head requires great movement.

Selecting Disk Scheduling Algorithms 3. Location of directories and index blocks: Every file must be opened before use. For this there is need to search directory structure to determine location of files. So, directories are accessed frequently. If the directory entry is on the first cylinder, and file data are on final cylinder then disk head requires to move the entire width of the disk.

Selecting Disk Scheduling Algorithms These three factors should be considered while selecting an algorithm.

Disk Management The operating system is responsible for several other aspect of disk management, too. In that, Disk Formatting (Disk initialization) Booting from disk Bad-block recovery

Swap-Space Management Swap-space management is another low-level task of the OS. Virtual memory uses disk space as an extension of main memory. Since disk access is much slower than memory access, using swap space significantly decreases system performance. The main goal for the design and implementation of swap space is to provide the best throughput for the virtual-memory system.

RAID Structure Full form of RAID is : “Redundant arrays of inexpensive disks”. It is a disk organization techniques. Advantages of RAID are: Improvement of Reliability via Redundancy. e.g RAID-1 Improvement of Performance via Parallelism e.g RAID-0

RAID Levels RAID is arranged into six different levels.

Disk Attachment Computer access disk storage in two ways. One way is via I/O port this is common on small systems. The other way is via a remote host via a distributed file system, this is referred as a network-attached storage.

Stable-Storage Implementation Write-ahead log scheme requires stable storage. To implement stable storage: Replicate information on more than one nonvolatile storage media with independent failure modes. Update information in a controlled manner to ensure that we can recover the stable data after any failure during data transfer or recovery.

Tertiary-Storage Structure Low cost is the defining characteristic of tertiary storage. So, in practice, tertiary storage is built with removable media. The most common examples of removable media are floppy disks, CD-ROMs etc., many other kind of tertiary-storage devices are available as well.

End of Chapter 12