next up previous
Next: Directory Structures Up: CS1011 lecture: Files and Previous: What is a file?

Magnetic disk storage

The most common physical device for storing files is the magnetic disk. Actually, a disk typically contains several rotating disks, or platters. The surfaces of the platters are covered in metal oxide, and read/written by electromagnetic recording heads, rather like those on an audio cassette recorder. There is one head for each surface, and all the heads move together. The disk rotates at around 3600 rpm (or approx 90mph), with the heads floating microscopic distances above the surfaces. Modern disks for workstations typically hold 500MB - 9GB, and cost of the order of £200 - 3000; prices are currently dropping rapidly.

The surface of a platter is organised as a number of concentric tracks. Each track is divided into sectors. The information held in one sector, a block, is the unit of transfer between the disk and primary memory (typically 4K bytes or so). The operating system determines where the blocks for each file are placed.

The time taken to access a particular block consists of:

All these times are of the order of tens of milliseconds. The seek time and latency are obviously variable, depending on where the required block is relative to the current position of the heads. It's useful to put all the blocks of a file on one track, to minimise seek times and latencies in accessing the file. Likewise, for a larger file, it's a good idea to have it all on the same cylinder (a set of corresponding tracks on different platters). There are many other placement tricks (such as placing heavily used files on the middle tracks so that the average seek time is reduced). However, since files are of very variable size, and can change size dynamically, it's not usually possible to place the blocks optimally.


next up previous
Next: Directory Structures Up: CS1011 lecture: Files and Previous: What is a file?
Pete Jinks
1998-10-30