A computer disk (or simply disk) is a data storage and retrieval device typically comprised of one or more circular recording surfaces connected by a common spindle that spins at high speeds. The data is accessed (i.e., either read or written) by a series of read-write heads, one head per recording surface. All read-write heads are attached to a single moving arm assembly, known as a boom, that moves in and out.
Each recording surface is divided into concentric zones called tracks. The length of each track is divided into a number of segments called sectors. Before a sector can be accessed, the sector must rotate until it is immediately adjacent to its read-write head. The set of tracks adjacent to all the read-write heads at a given instant in time is known as a cylinder.
To access a particular sector, the boom must be moved to the correct cylinder and then the sector must rotate until it is immediately adjacent to its read-write head. The time required to move the boom from one cylinder to another is known as seek time. The time required for a sector to move from its current position to a position immediately adjacent to its read-write head is called latency time.
Seek times are an order of magnitude greater than latency times. Thus, it is desirable to reduce the number of seeks and, when a seek is necessary, to move the boom across as few cylinders as possible.
Sectors are usually numbered, starting with number zero, from the first track on the first cylinder, moving from track to track in a single cylinder, and then moving from cylinder to cylinder. This numbering scheme positions sectors with consecutive numbers on the same cylinder or on an adjacent cylinder.
The operating system of a computer is responsible for allocating sectors to files and maintaining a table, commonly known as the directory, which contains a list of the files that are stored on the disk. The directory also relates which sectors are allocated to each file and which sectors are currently unallocated. The directory is typically stored on the disk in sectors reserved by the operating system for that purpose.
The number of sectors allocated to a file depends on the sector size and the size of the file. Most computer operating systems indiscriminately allocate sectors to a file wherever they are available. In addition, a nonconsecutive allocation scheme is usually used which allows files to become fragmented. Because files tend to grow or shrink over time, the amount of fragmentation can become severe.
To reduce the number and magnitude of seeks, it is desirable to have all sectors of a file stored in consecutively numbered sectors, and it is also desirable to have the files which represent the majority of disk accesses stored consecutively.
Numerous computer programs have been written whose purpose is to monitor and record file usage. In common use, these programs collect data on the number of accesses to each file and the changes in each file's size.
More numerous are computer programs that have been written to increase disk performance by copying files to a different and preferred set of sectors. These programs are referred to as disk optimizers. The simplest disk optimizers merely copy fragmented files to consecutive sectors. The problem with this approach is that as each file is copied, it trades 2 or more blocks of consecutive sectors for 1 block of consecutive sectors. This accelerates the fragmentation of the unallocated sectors and increases the likelihood of new files being fragmented.
More advanced disk optimizers completely reorder a disk by copying files to consecutive sectors, starting with the lowest numbered sector not occupied by the directory, such that no file is fragmented and no sectors are left unallocated between files. This results in all unallocated sectors having consecutive numbers and decreases the rate of future file fragmentation, since new files can easily be allocated to consecutive sectors.
While those advanced disk optimizers are able to eliminate the increased seek times that result from file fragmentation, they do not decrease the seek time required to move the boom from the sectors of one file to the sectors of another file. It is desirable that the files which represent the majority of disk accesses be grouped into neighboring sectors to reduce or eliminate the seek time required to access them.
Further, existing disk optimizers require the computer user to run the disk optimizer program and then start the optimization process. With today's computers, especially personal computers, being used by computer novices, this places an added burden on the user to remember to run the disk optimizer program on a regular basis.