37. Hard Disk Drives.pdf - 37 Hard Disk Drives The last chapter introduced the general concept of an I\/O device and showed you how the OS might interact

37. Hard Disk Drives.pdf - 37 Hard Disk Drives The last...

This preview shows page 1 - 3 out of 16 pages.

37Hard Disk DrivesThe last chapter introduced the general concept of an I/O device andshowed 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 storage incomputer 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? What is the interface?How is the data actually laid out and accessed? How does disk schedul-ing improve performance?37.1The 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 be reador written. The sectors are numbered from0ton1on a disk withnsectors. Thus, we can view the disk as an array of sectors;0ton1isthus theaddress spaceof the drive.Multi-sector operations are possible; indeed, many file systems willread 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(i.e., it will either complete in its entirety or it won’t com-plete at all); thus, if an untimely power loss occurs, only a portion of alarger write may complete (sometimes called atorn write).There are some assumptions most clients of disk drives make, butthat are not specified directly in the interface; Schlosser and Ganger have1
Background image
2HARDDISKDRIVES01110987654321SpindleFigure 37.1: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 (i.e., a sequential read or write) is the fastest access mode, andusually much faster than any more random access pattern.37.2Basic GeometryLet’s start to understand some of the components of a modern disk.We start with aplatter, a circular hard surface on which data is storedpersistently by inducing magnetic changes to it. 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 powered off.
Background image
Image of page 3

You've reached the end of your free preview.

Want to read all 16 pages?

  • Fall '14

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture