chapter 12.4 mass-storage systems. 12.2 silberschatz, galvin and gagne ©2005 operating system...

36
Chapter 12.4 Mass-Storage Chapter 12.4 Mass-Storage Systems Systems

Post on 19-Dec-2015

216 views

Category:

Documents


0 download

TRANSCRIPT

Chapter 12.4 Mass-Storage SystemsChapter 12.4 Mass-Storage Systems

12.2 Silberschatz, Galvin and Gagne ©2005Operating System Concepts

Chapter 12-3 Mass-Storage SystemsChapter 12-3 Mass-Storage Systems

Chapter 12-1:

Overview of Mass Storage Structure

Chapter 12-2:

Disk Attachment

Disk Scheduling

Chapter 12-3:

Disk Management

Swap-Space Management

RAID Structure

Chapter 12-4

RAID Structure

Stable-Storage Implementation

Tertiary Storage Devices

Operating System Issues

Performance Issues

12.3 Silberschatz, Galvin and Gagne ©2005Operating System Concepts

RAID – Continued

12.4 Silberschatz, Galvin and Gagne ©2005Operating System Concepts

RAID – different source – modified here and there.

RAID is a technology that employs the simultaneous use of two or more hard disk drives to achieve greater levels of performance, reliability, and/or larger data volume sizes.

The phrase "RAID" is an umbrella term for computer data storage schemes that can divide and replicate data among multiple hard disk drives.

RAID's various designs all involve two key design goals: increased data reliability and increased input/output performance.

When several physical disks are set up to use RAID technology, they are said to be in a RAID array.

This array distributes data across several disks, but the array is seen by the computer user and operating system as one single disk.

12.5 Silberschatz, Galvin and Gagne ©2005Operating System Concepts

RAID - (continued) - Features Principle: Some arrays are "redundant" in a way such that write operations

result in extra data derived from original data captured across an array of disks organized so that the failure of one (sometimes more) disks in the array will not result in loss of data; a bad disk is replaced by a new one, and the data on it can be

reconstructed from the remaining data and the extra data.

Other RAID arrays are arranged so that they are faster to write to and read from than a single disk.

It is important to note that a redundant array allows less data to be stored. For instance, a 2-disk RAID 1 array loses half of its capacity, (because data is stored twice) and a RAID 5 array with several disks loses the capacity of one full disk.

There are various combinations of these approaches giving different trade offs of protection against data loss, capacity, and speed.

RAID levels 0, 1, and 5 are the most commonly found, and cover most requirements.

12.6 Silberschatz, Galvin and Gagne ©2005Operating System Concepts

RAID - (continued) – Important Levels RAID 0 (striped disks) distributes data across several disks in a

way which gives improved speed and full capacity, but all data on all disks will be lost if any one disk fails. (figures ahead)

RAID 1 (mirrored disks) (could be described as a backup solution) uses two (possibly more) disks which each store the same data (hence the term ‘mirrored’), so that data is not lost as long as one disk survives.

Total capacity of the array is just the capacity of a single disk. The failure of one drive, in the event of a hardware or software

malfunction, does not increase the chance of a failure nor decrease the reliability of the remaining drives (second, third, etc).

RAID 5 (striped disks with parity) combines three or more disks in a way that protects data against loss of any one disk. Here, capacity of the array is reduced by one disk.

RAID 6 (less common) can recover from the loss of two disks.

12.7 Silberschatz, Galvin and Gagne ©2005Operating System Concepts

RAID Levels 0, 1, and 2

In RAID Level 0: we’ve got no redundancy.

Our array of disks has striping at the block level.

In RAID Level 1: we have disk mirroring.

For RAID Level 2, I will not discuss, because it is rarely used.

12.8 Silberschatz, Galvin and Gagne ©2005Operating System Concepts

RAID – (continued) – Computations Involved RAID involves significant computation when reading and writing

information.

With true RAID hardware the disk controller does all of this computation work.

In other cases the operating system or simpler and often less expensive controllers require the host computer's processor to do the computing, (which reduces the computer's performance on processor-intensive tasks).

Simpler RAID controllers may provide only levels 0 and 1, which require less processing.

12.9 Silberschatz, Galvin and Gagne ©2005Operating System Concepts

RAID (continued) – Rebuilding Systems

A very nice feature is that RAID systems with redundancy continue working without interruption when one, or sometimes more, disks of the array fail, although they are vulnerable to further failures.

When the bad disk is replaced by a new one the array is rebuilt while the system continues to operate normally.

Some systems have to be shut down when removing or adding a drive; others support this kind of hot swapping, allowing drives to be replaced without powering down.

RAID with hot-swap drives is often used in high availability systems, where it is essential that the system keeps running as much of the time as possible.

12.10 Silberschatz, Galvin and Gagne ©2005Operating System Concepts

RAID (continued) Backup?

RAID is not, in general, a good alternative to backing up data. In general, data may become damaged or destroyed without harm to

the drive(s) on which it is stored. For example,

Part of the data may be overwritten by a system malfunction; A file may be damaged or deleted by user error or malice and not

noticed for days or weeks; Of course the entire array is at risk of catastrophes such as theft,

flood, and fire.

Presented ahead are a few more visuals from the text and some additional information.

Please also note that there are additional configurations of RAIDs that we will not discuss.

12.11 Silberschatz, Galvin and Gagne ©2005Operating System Concepts

RAID Level3RAID Level3 RAID 3 is a bit-interleaved parity organization.

“Unlike memory systems, disk controllers can detect whether a sector has been read correctly, so a single parity bit can be used for error correction as well as for detection.

If one of the sectors is damaged, we know exactly which sector it is and the controller can figure out whether any bit in the sector is a 1 or a 0 by computing the parity of the corresponding bits from the sectors in the other disks.

If the parity of the remaining bits is equal to the stored parity, the missing bit is 0; otherwise, it is 1. .

RAID level 3 is good as level 2 but is less expensive in the number of extra disks required (it has only one-disk overhead), so level 2 is not used in practice.

12.12 Silberschatz, Galvin and Gagne ©2005Operating System Concepts

RAID Levels 4

RAID 4 is block interleaving

12.13 Silberschatz, Galvin and Gagne ©2005Operating System Concepts

More RAID Levels

RAID6 – more Text elaborates in more detail on RAID6 and cites that additional redundant information is stored to guard against multiple disk failures.

Most schemes use parity; RAID6 uses error detecting and correcting code

Two bits of data are stored for every 4 bits of data; as compared to one parity bit in level 5.

System can tolerate two disk failures.

One more slide:

12.14 Silberschatz, Galvin and Gagne ©2005Operating System Concepts

More RAID Levels

RAID Level 0 + 1 Here’s an attempt to get the best of both worlds: RAID 0 provides performance gains;

Striping provides simultaneous access RAID 1 provides reliability (mirroring).

Reliability and backup are clear via mirroring.

But this approach requires twice as many disks as RAID1 and it is more expensive.

Here, in RAID 0 + 1, we have striped disks (RAID 0) with mirroring of the strips as in RAID 1 (hence twice as many disks)

And there are others…and all have variations…

12.15 Silberschatz, Galvin and Gagne ©2005Operating System Concepts

Stable Storage Implementation

12.16 Silberschatz, Galvin and Gagne ©2005Operating System Concepts

Stable-Storage Implementation (two slides) Stable-Storage Implementation (two slides)

Here we are addressing storage such that the information on these devices is never lost.

In order to do this, updates need to be planned such that a failure during an update will not leave all copies in a corrupted state and that a recovery ensures all data will be consistent.

It is all about ‘writes’ to disk

A write can result in

A success. (this is what we wish, of course)

Partial failure – problems during and update. Some data may be updated; some not; failure probably occurred in writing to a specific sector on the disk.

Total failure – Failure occurs before disk write, so previous data values are still okay..

12.17 Silberschatz, Galvin and Gagne ©2005Operating System Concepts

Stable Storage – ImplementationStable Storage – Implementation

Usually done by maintaining two physical blocks for each logical block in nonvolatile storage.

Write one physical block.

When successfully completed, write the second physical block.

When this successfully completes, we are complete with ‘that’ write…

A large number of copies is really not necessary; two copies in stable storage pretty much guarantee safety unless all copies are destroyed.

12.18 Silberschatz, Galvin and Gagne ©2005Operating System Concepts

Tertiary Storage Issues

12.19 Silberschatz, Galvin and Gagne ©2005Operating System Concepts

Tertiary Storage DevicesTertiary Storage Devices

Low cost is the defining characteristic of tertiary storage.

Generally, tertiary storage is built using removable media

Common examples of removable media are floppy disks and CD-ROMs; other types are available.

Technologies change here all the time.

Read about removable disks, optical disks, and WORM disks.

12.20 Silberschatz, Galvin and Gagne ©2005Operating System Concepts

TapesTapes

Compared to a disk, a tape is less expensive and holds more data, but random access is much slower.

Not practical for random access, unless one is searching for a file on the tape, or similar activity.

Generally data transfer speeds from tapes are similar to disks.

Tape is an economical medium for purposes that do not require fast random access, e.g., backup copies of disk data, holding huge volumes of data.

Large tape installations typically use robotic tape changers that move tapes between tape drives and storage slots in a tape library.

stacker – library that holds a few tapes

silo – library that holds thousands of tapes

A disk-resident file can be archived to tape for low cost storage; the computer can stage it back into disk storage for active use.

12.21 Silberschatz, Galvin and Gagne ©2005Operating System Concepts

Operating System Issues

12.22 Silberschatz, Galvin and Gagne ©2005Operating System Concepts

Operating System IssuesOperating System Issues

Major OS jobs are to

manage physical devices and to

present a virtual machine abstraction to applications

For hard disks, the OS provides two abstractions:

Raw device – an array of data blocks.

File system – the OS queues and schedules the interleaved requests from several applications.

12.23 Silberschatz, Galvin and Gagne ©2005Operating System Concepts

Application InterfaceApplication Interface

Most OSs handle removable disks almost exactly like fixed disks — a new cartridge is formatted and

- an empty file system is generated on the disk.

Tapes are presented as a raw storage medium, i.e., and an application does not open a file on the tape, it accesses / opens the whole tape drive as a raw device.

Usually the tape drive is reserved for the exclusive use of a specific application. But in truth, files can be stored sequentially on this medium.

Since the OS does not provide file system services for tapes, the application must decide how to use the array of blocks.

Since every application makes up its own rules for how to organize a tape, a tape full of data can generally only be used by the program that created it.

12.24 Silberschatz, Galvin and Gagne ©2005Operating System Concepts

Tape DrivesTape Drives The basic operations for a tape drive differ from those of a disk drive.

We locate positions on the tape to a specific logical block

The read position operation returns the logical block number where the tape head is.

Can backspace a tape and often done to re-read data.

Tape drives are “append-only” devices; updating a block in the middle of the tape also effectively erases everything beyond that block.

An EOT mark is placed after a block that is written.

Tapes often have labels on the front end – alluded to earlier.

Sometimes ‘scratch’ tapes are needed too.

Labels often cite the nature, owner, security, block size, etc. of the file that follows. Often have multiple files on same tape volume.

Reflector strips are found in the beginning and end of tape itself.

12.25 Silberschatz, Galvin and Gagne ©2005Operating System Concepts

File NamingFile Naming The issue of naming files on removable media is especially difficult

when we want to write data on a removable cartridge on one computer, and then use the cartridge in another computer.

Contemporary OSs generally leave the name space problem unsolved for removable media, and depend on applications and users to figure out how to access and interpret the data.

On a PC, file names have a specific path starting with the drive letter. In Unix, the mount table assist the OS to discover on what drive the file

is located. There’s a lot of variability even in text storage:

Some computers record text in ASCII (on PCs); others in EBCDIC (mainframes).

There is, however, a lot of standardization in formats for music CDs (a format understood by all CD drives); Data CDs only have a few different formats.

So the CD drive and the operating system device drivers are programmed to recognize a number of common formats.

12.26 Silberschatz, Galvin and Gagne ©2005Operating System Concepts

Performance Issues

12.27 Silberschatz, Galvin and Gagne ©2005Operating System Concepts

Performance Issues for Tertiary StoragePerformance Issues for Tertiary Storage

The three issues:

Speed

Reliability

Cost

12.28 Silberschatz, Galvin and Gagne ©2005Operating System Concepts

Speed Speed

Two aspects of speed in tertiary storage are bandwidth and latency.

Bandwidth is simply measured in bytes per second.

Sustained bandwidth – average data rate during a large transfer; the number of bytes/transfer time.

Data rate = when the data stream is actually flowing There are so many other variables that can enter the picture.

Effective bandwidth – average over the entire I/O time, including seek or locate, and cartridge switching.Drive’s overall data rate.

Removable disks and tapes: quite close in speed.. Range from a few meg/sec to over 40 MB in removable disks; 30 MB

for tapes.

12.29 Silberschatz, Galvin and Gagne ©2005Operating System Concepts

Speed (Cont.)Speed (Cont.)

Access latency – amount of time needed to locate data.

Access time for a disk – move the arm to the selected cylinder and wait for the rotational latency; < 35 milliseconds.

Access on tape requires winding the tape reels until the selected block reaches the tape head; tens or hundreds of seconds.

Generally say that random access within a tape cartridge is about a thousand times slower than random access on disk.

Personally, I don’t consider a tape as a random access device!

The low cost of tertiary storage is a result of having many cheap cartridges share a few expensive drives.

A removable library is best devoted to the storage of infrequently used data, because the library can only satisfy a relatively small number of I/O requests per hour.

12.30 Silberschatz, Galvin and Gagne ©2005Operating System Concepts

ReliabilityReliability A fixed disk drive is likely to be more reliable than a removable disk or tape drive.

Simply stated, the reliability of removable media is just not as great as permanent storage devices.

Comparing removable disks with tapes, tapes are even less reliable, since they are exposed to environmental conditions much more than disks. Too, they are often ‘handled’ by humans! Then too, magnetic tape drives can wear out tapes very quickly.. Note that a mag tape r/w head comes in contact with the tape itself.

Magnetic disks have their head as the weak spot, and can become misaligned.

An optical cartridge is likely to be more reliable than a magnetic disk or tape. This is because the layer that stores the bits is protected by a transparent plastic

or glass layer.

So fixed disks are reliable except if a head crashes; this often destroys the data. Optical disk drives are more reliable than removable disk or tape drives. Failure of a tape drive or optical disk drive often leaves the data cartridge

unharmed.

12.31 Silberschatz, Galvin and Gagne ©2005Operating System Concepts

CostCost

Primary (Main) memory is much more expensive than disk storage

The cost per megabyte of hard disk storage is competitive with magnetic tape if only one tape is used per drive.

The cheapest tape drives and the cheapest disk drives have had about the same storage capacity over the years.

Tertiary storage gives a cost savings only when the number of cartridges is considerably larger than the number of drives.

Let’s consider a few comparisons…

12.32 Silberschatz, Galvin and Gagne ©2005Operating System Concepts

Price per Megabyte of Price per Megabyte of DRAMDRAM, From 1981 to 2004, From 1981 to 2004

Values reflect lowest costs found commercially.

Can see dramatic drop in cost / MB of dynamic RAMSome fluctuations causes by excess production.Raises reflect shortages in the marketplace.

Overall, an incredible decrease in cost!

12.33 Silberschatz, Galvin and Gagne ©2005Operating System Concepts

Price per Megabyte ofPrice per Megabyte of Magnetic Hard DiskMagnetic Hard Disk, From 1981 to 2004, From 1981 to 2004

Here, the decline of cost/MB has been very steady, although the decline is steeper in the mid 90s. Can see some tapering off, but still declining…

12.34 Silberschatz, Galvin and Gagne ©2005Operating System Concepts

Price per Megabyte of a Price per Megabyte of a TapesTapes, From 1984-2000, From 1984-2000

Tape drive prices have fallen to – reasonably steadily.Around 1997, the fall has nearly stopped.

12.35 Silberschatz, Galvin and Gagne ©2005Operating System Concepts

Price of Storage The cost of storage has fallen tremendously and is reasonably the same slope for

DRAM, disks, and tapes.

Interestingly, as your book points out, the price per megabyte of magnetic disk has improved by more than four orders of magnitude during the past twenty years;

Corresponding costs of primary memory has only been three orders of magnitude (that’s ten times the difference!)

Main memory today is more expensive than disk storage by a factor of 100. Interestingly, the price per MB for disks has dropped more rapidly than for tapes. “in

fact, the price per megabyte of a magnetic disk drive is approaching that of a tape cartridge without the tape drive. Consequently, small- and medium-sized tape libraries have a higher storage cost than disk systems with equivalent capacity.”

With huge drops in disk prices, tertiary storage is about obsolete. No tertiary storage technology is orders of magnitudes less expensive than magnetic

disk. We will await a new revolutionary technology.

Magnetic tapes are almost exclusively limited to backups of disks and archival storage in huge tape libraries possessing huge storage capacities.

End of Chapter 12.4End of Chapter 12.4