The data on your hard drive (disk) is stored in blocks of uniform size called "clusters". Usually the blocks are like 4,096 bytes or 8,192 bytes or something in size. The reason they put them in clusters is cause there would be a lot more 'overhead' involved in keeping track of the files if they did it on a byte-by-byte basis. To make it easier and faster to read, the clusters are numbered sequentially as you fill your disk.
There are two main structures that are used to keep track of all the clusters and to which programs or files they belong. One is called a "Directory" and the other one is called a "File Allocation Table" (FAT). There is a directory entry for every file you have on your computer. It tells you things like the name of a file, the file attributes (read only, hidden, etc.), the size of a file, and the cluster number where the data of the file starts. The FAT table's job is to tell us where all the subsequent clusters of that file are.
When your computer reads a (non-fragmented) file, your hard drive reads Cluster 1, then cluster 2, then cluster 3...etc., Now in the course of using your computer - creating, deleting and modifying files - these clusters become more and more non-sequential. Instead of being in clusters 1, 2, 3 a file could be placed in clusters 1, 73, 1464. This is called "fragmentation".
When this happens, your hard drive reads cluster 1, stops, moves it's read head to cluster 73, reads cluster 73, stops, moves the read head to cluster 1464, reads cluster 1464, stops...etc. Files can get so fragmented that the next cluster in the series could be on the opposite end of the disk from the last cluster and your drive spends more time moving its head to the correct location of the data than it does actually reading the data.
What defrag does is reorganize the clusters that make up your files (puts file 1's clusters in a row, followed by file 2's clusters...etc.) so that they always are in sequential order, giving you the fastest reading of your files from the disk. Another very important reason to defrag is because the more fragmented the files on your hard drive are, the more likely a disk error is to destroy them.
|