Presentation is loading. Please wait.

Presentation is loading. Please wait.

Disks.

Similar presentations


Presentation on theme: "Disks."— Presentation transcript:

1 Disks

2 Disks.. Magnetic Disks.. Most common (magnetic hard disks)
Reads and writes are equally fast. Arrays of these disks are used to provide highly reliable storage. Increasingly popular as they are fast and do not contain moving parts. Magnetic Disks.. What is a magnetic disk and how it works

3 RAID (Redundant Array of Inexpensive Disks)..
RAID is a data storage virtualization technology that combines multiple physical disk drive components into a single logical unit for the purposes of data redundancy, performance improvement, or both. Data is distributed across the drives in one of the several ways, referred as RAID levels depending on the level of redundancy & performance. Each RAID level provides different balance among the key goals; reliability, availability, performance, and capacity. RAID levels greater than RAID 0 provide protection against unrecoverable sector read errors, and also against failures of whole physical drives. RAID levels video

4 Disk Formatting.. Preparing a disk drive for data storage involves three steps: Low - level formatting (physical) Partitioning High - level formatting (logical)

5 Low - level formatting.. Sequentially number tracks and sectors
Identifies each track and sector Disk is physically prepared to hold data

6 Partitioning.. Partitioning a disk is the act of defining areas of the disk for an operating system to use. Partitioning is required because a hard disk is designed to be used with more than one operating system. Partitioning enable a single operating system to use the disk as several volumes or logical drives.

7 High - level formatting..
A part of the system area is called the “Master boot sector”. This is the process of creating the disk's logical structures such as the file allocation table and root directory. The Master boot sector is: Always the first sector (sector 0) of the first track (track 0) of the first cylinder (cylinder 0) disk. 512 bytes long, just like any other sector Contains information on all logical drives, regardless of whether they are bootable.

8 How Data is Organized on Disk..
Tracks: Circular areas of the disk Length of a track one circumference of disk Over 1000 on a hard disk Data first written to outer most track Sectors: Divides tracks sections Cylinders: Logical groupings of the the same track on each disk surface in a disk unit Clusters: Groups of sectors used by operating system

9 What are the three steps of preparing a disk drive for data storage?..
Preparing a disk drive for data storage involves three steps: Low - level formatting (physical) Partitioning High - level formatting (logical)

10 Disk Arm Scheduling Algorithms..
Three factors that determine the time required to read or write a disk block: Seek time (the time to move the arm to the proper cylinder). Rotational delay (how long for the proper sector to appear under the reading head). Actual data transfer time. For most disk , the seek time dominates the other times, so reducing the mean seek time can improve system performance substantially.

11 First Come First Served (FCFS)..
The disk driver accepts requests one at a time and carries them out in the in that order. Least efficient

12 Cylinder Index Table 1 2 3 4 5 6 7 8 9 Block 2 Block 3 Block 4 Block 5 Block 16 Block 17 Block 18 Block 0 Block 1 Block 20 Block 21 Block 22 Block 23 Block 1 Block 2 Block 3 Block 5 Block 6 Block 30 Block 31 Block 32 Block 33 Block 10 Block 11 Block 12 Block 13 Block 19 Block 23 Block 24

13 Shortest Seek First Cylinder requests: 12, 9, 16, 1, 34, 36 Sequence: 12, 9, 16, 1, 34, 36 Figure Shortest Seek First (SSF) disk scheduling algorithm. Arm motions: 1, 3, 7, 15, 33, 2 equaling a total of 61 cylinders.

14 Elevator algorithm Cylinder requests: 12, 9, 16, 1, 34, 36 Sequence: 12, 16, 34, 36, 9 , 1 Figure The elevator algorithm for scheduling disk requests. Arm motions: 1, 4, 18, 2, 27, 8 equaling a total of 60 cylinders.

15 Error Handling.. It is not possible to manufacture a disk to such specifications without defects. As technology improves, designers will increase capacity by going to higher densities. If the defect is bigger the error cannot be masked Errors can during normal operation, usually after the drive has been installed.

16 Two approaches to handling errors..
Handle in controller If the controller cannot remap sectors, the operating system must do the same thing in software. Once it knows which sectors are bad it can build remapping tables Handle in operator Make sure that bad sectors do not occur in any files

17 Stable Storage Everyone is happier when there data hasn’t been lost.
Just look at this lady.

18 Stable Storage As you may know, disks sometimes make errors. Good sectors can suddenly become bad sectors. Whole drives can die unexpectedly. For some applications, it is essential that data never be lost or corrupted, even with errors. Ideally, a disk should simply work all the time with no errors. Unfortunately, that is not achievable. What is achievable is a disk subsystem that has the following property: when a write is issued to it, the disk either correctly writes the data or it does nothing, leaving the existing data intact. Such a system is called stable storage and is implemented in software .

19 Stable Storage Goal The goal is to keep the disk consistent at all costs. The model assumes that when a disk writes a block (one or more sectors), either the write is correct or it is incorrect. The errors can be detected on a subsequent read by examining the values of the ECC(error correction code) fields.

20 Stable Storage Assumptions
The model assumes the CPU can fail, in which case it just stops Any disk write in progress at the moment of failure also stops, leading to incorrect data in one sector. This can be detected later. Under all these conditions, stable storage can be made 100% reliable, where the data either writes correctly or leaves the old data in place.

21 Stable Storage Does Not Protect Against..
Physical disasters or an upset girlfriend.

22 How it works Stable storage uses a pair of identical disks with the corresponding blocks working together to form one error-free block. STABLE WRITES: A stable write consists of first writing the block on drive 1, then drive 2 STABLE READS: A stable read first reads the block from drive 1, if the read fails after n attempts it is read from drive 2 CRASH RECOVERY: After a crash, a recovery program scans both disks comparing corresponding blocks.If one of them has an ECC error, the bad block is overwritten with the corresponding good block.

23 If the CPU crashes during stable writes?
Depending on when the crash occurs there are five possibilities.

24 Works Cited Tanenbaum, Andrew S. Modern operating systems. Boston: Pearson, Print.


Download ppt "Disks."

Similar presentations


Ads by Google