Example: bankruptcy

Hard Disk Drives

37 hard disk DrivesThe last chapter introduced the general concept of an I/O deviceandshowed you how the OS might interact with such a beast. In this chapter,we dive into more detail about one device in particular: thehard diskdrive. These Drives have been the main form of persistent data storageincomputer systems for decades and much of the development of file sys-tem technology (coming soon) is predicated on their behavior. Thus,itis worth understanding the details of a disk s operation before buildingthe file system software that manages it. Many of these details are avail-able in excellent papers by Ruemmler and Wilkes [RW92] and Anderson,Dykes, and Riedel [ADR03].CRUX: HOWTOSTOREANDACCESSDATAONDISKHow do modern hard - disk Drives store data?

HARD DISK DRIVES 3 Head Arm 0 11 10 9 8 7 6 5 4 3 2 1 Spindle Rotates this way Figure 37.2: A Single Track Plus A Head 37.3 A Simple Disk Drive Let’s understand how disks work by building up a model one track at

Tags:

  Drive, Hard, Disk, Hard disk drives

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Advertisement

Transcription of Hard Disk Drives

1 37 hard disk DrivesThe last chapter introduced the general concept of an I/O deviceandshowed you how the OS might interact with such a beast. In this chapter,we dive into more detail about one device in particular: thehard diskdrive. These Drives have been the main form of persistent data storageincomputer systems for decades and much of the development of file sys-tem technology (coming soon) is predicated on their behavior. Thus,itis worth understanding the details of a disk s operation before buildingthe file system software that manages it. Many of these details are avail-able in excellent papers by Ruemmler and Wilkes [RW92] and Anderson,Dykes, and Riedel [ADR03].CRUX: HOWTOSTOREANDACCESSDATAONDISKHow do modern hard - disk Drives store data?

2 What is the interface?How is the data actually laid out and accessed? How does disk schedul-ing improve performance? The InterfaceLet s start by understanding the interface to a modern disk drive . Thebasic interface for all modern Drives is straightforward. The drive consistsof a large number of sectors (512-byte blocks), each of which can bereador written. The sectors are numbered from0ton 1on a disk withnsectors. Thus, we can view the disk as an array of sectors;0ton 1isthus theaddress spaceof the operations are possible; indeed, many file systemswillread or write 4KB at a time (or more). However, when updating the disk ,the only guarantee drive manufacturers make is that a single 512-bytewrite isatomic( , it will either complete in its entirety or it won t com-plete at all); thus, if an untimely power loss occurs, only a portionof alarger write may complete (sometimes called atorn write).

3 There are some assumptions most clients of disk Drives make, butthat are not specified directly in the interface; Schlosser and Ganger have12 HARDDISKDRIVES01110987654321 SpindleFigure :A disk With Just A Single Trackcalled this the unwritten contract of disk Drives [SG04]. Specifically,one can usually assume that accessing two blocks1near one-another withinthe drive s address space will be faster than accessing two blocks that arefar apart. One can also usually assume that accessing blocks in a contigu-ous chunk ( , a sequential read or write) is the fastest access mode, andusually much faster than any more random access Basic GeometryLet s start to understand some of the components of a modern start with aplatter, a circular hard surface on which data is storedpersistently by inducing magnetic changes to it.

4 A disk may have oneor more platters; each platter has 2 sides, each of which is called asur-face. These platters are usually made of some hard material (such asaluminum), and then coated with a thin magnetic layer that enables thedrive to persistently store bits even when the drive is platters are all bound together around thespindle, which is con-nected to a motor that spins the platters around (while the driveis pow-ered on) at a constant (fixed) rate. The rate of rotation is often measured inrotations per minute (RPM), and typical modern values are in the 7,200 RPM to 15,000 RPM range. Note that we will often be interested inthetime of a single rotation, , a drive that rotates at 10,000 RPMmeansthat a single rotation takes about 6 milliseconds (6 ms).

5 Data is encoded on each surface in concentric circles of sectors; we callone such concentric circle atrack. A single surface contains many thou-sands and thousands of tracks, tightly packed together, with hundreds oftracks fitting into the width of a human read and write from the surface, we need a mechanism that allowsus to either sense ( , read) the magnetic patterns on the disk or to in-duce a change in ( , write) them. This process of reading andwriting isaccomplished by thedisk head; there is one such head per surface of thedrive. The disk head is attached to a singledisk arm, which moves acrossthe surface to position the head over the desired , and others, often use the termsblockandsectorinterchangeably, assuming thereader will know exactly what is meant per context.

6 Sorry about this!OPERATINGSYSTEMS[ ] this wayFigure :A Single Track Plus A A Simple disk DriveLet s understand how disks work by building up a model one track ata time. Assume we have a simple disk with a single track (Figure ).This track has just 12 sectors, each of which is 512 bytes in size(our typicalsector size, recall) and addressed therefore by the numbers 0 through single platter we have here rotates around the spindle, to which amotor is course, the track by itself isn t too interesting; we want to be ableto read or write those sectors, and thus we need a disk head, attachedto a disk arm, as we now see (Figure ). In the figure, the diskhead,attached to the end of the arm, is positioned over sector 6, and the surfaceis rotating Latency: The Rotational DelayTo understand how a request would be processed on our simple, one-track disk , imagine we now receive a request to read block 0.

7 How shouldthe disk service this request?In our simple disk , the disk doesn t have to do much. In particular, itmust just wait for the desired sector to rotate under the disk head. Thiswait happens often enough in modern Drives , and is an important enoughcomponent of I/O service time, that it has a special name:rotational de-lay(sometimesrotation delay, though that sounds weird). In the exam-ple, if the full rotational delay isR, the disk has to incur a rotational delayof aboutR2to wait for 0 to come under the read/write head (if we start at6). A worst-case request on this single track would be to sector 5,causingnearly a full rotational delay in order to service such a Tracks: Seek TimeSo far our disk just has a single track, which is not too realistic;moderndisks of course have many millions.

8 Let s thus look at an ever-so-slightlymore realistic disk surface, this one with three tracks (Figure , left).In the figure, the head is currently positioned over the innermosttrack(which contains sectors 24 through 35); the next track over contains the 2008 20, ARPACI-DUSSEAUTHREEEASYPIECES4 HARDDISKDRIVES01110987654321122322212019 181716151413243534333231302928272625 SpindleRotates this waySeekRemaining rotation32101110987654151413122322212019 181716272625243534333231302928 SpindleRotates this wayFigure :Three Tracks Plus A Head (Right: With Seek)next set of sectors (12 through 23), and the outermost track contains thefirst sectors (0 through 11).To understand how the drive might access a given sector, we now tracewhat would happen on a request to a distant sector, , a read tosector11.

9 To service this read, the drive has to first move the disk armto the cor-rect track (in this case, the outermost one), in a process known as , along with rotations, are one of the most costly disk seek, it should be noted, has many phases: first anaccelerationphase as the disk arm gets moving; thencoastingas the arm is movingat full speed, thendecelerationas the arm slows down; finallysettlingasthe head is carefully positioned over the correct track. Thesettling timeis often quite significant, , to 2 ms, as the drive must be certain tofind the right track (imagine if it just got close instead!).After the seek, the disk arm has positioned the head over the righttrack. A depiction of the seek is found in Figure (right).

10 As we can see, during the seek, the arm has been moved to the desiredtrack, and the platter of course has rotated, in this case about 3 , sector 9 is just about to pass under the disk head, and we mustonly endure a short rotational delay to complete the sector 11 passes under the disk head, the final phase of I/Owill take place, known as thetransfer, where data is either read from orwritten to the surface. And thus, we have a complete picture of I/O time:first a seek, then waiting for the rotational delay, and finally the Other DetailsThough we won t spend too much time on it, there are some other inter-esting details about how hard Drives operate. Many Drives employsomekind oftrack skewto make sure that sequential reads can be properlyserviced even when crossing track boundaries.


Related search queries