Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 12: Mass-Storage Systems

Similar presentations


Presentation on theme: "Chapter 12: Mass-Storage Systems"— Presentation transcript:

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

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

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

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

5 Physical Geometry of a Disk

6 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)

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

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

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

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

11 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

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

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

14 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

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

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

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

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

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

20 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

21 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

22 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) =640 cylinders

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

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

25 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

26 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)+( )+( ) =236 cylinders

27 SSTF

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

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

30 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

31 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)+( )+( ) =236cylinders

32 SCAN Scheduling

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

34 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

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

36 LOOK Scheduling 25 15 30 55 60 65 90 99 5

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

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

39 C-SCAN (Cont.)

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

41 C-LOOK (Cont.)

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

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

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

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

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

47 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

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

49 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

50 RAID Levels RAID is arranged into six different levels.

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

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

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

54 End of Chapter 12


Download ppt "Chapter 12: Mass-Storage Systems"

Similar presentations


Ads by Google