create new tag
, view all tags
See BLT.

disk fragmentation: A file often fills more than one cluster (?) of a disk. When files are written to a previously unused disk or partition, they are written with their contents occupying successive clusters, so, in some sense, the file is in a proper order. As the disk is used, and files are added and deleted, and, for example, a large file starts to be stored where a small file used to be, the files cannot always be stored in successive clusters. A file might be stored in two clusters here, one there, two more somewhere else, etc.

This condition is called fragmentation, and it makes access to the files slower, because the heads must jump from place to place to access the file in order (see #Elevator_Seek_Strategies). Some filesystems are less subject to fragmentation than others. Filesystems that are subject to significant fragmentation often have a utility, sometimes called a defragger, that will rearrange the files to reduce fragmentation. Another remedy for fragmentation is to backup all the data (not as a disk image), delete all the data from the partition (it usually makes sense to reformat the partition at this point), then write the data back from the backup (or reinstall software from scratch).

Both dos/Windows and Linux filesystems are subject to fragmentation, but my understanding is that the ext2 filesystem does not usually get very fragmented. I don't know why. Some other Linux filesystems (xfs, jfs, ext3, Reisers) may be more subject to fragmentation.


The "fat, dumb, and happy" method to read a file when its data is scattered here and there on a disk is to read the first cluster, then the second cluster, then the third cluster, and so on, in that order.

Disk access has become much faster where cache is used in conjunction with special strategies to get the data in the most efficient way for the disk drive.

One such strategy (or family of strategies) is known as an elevator seek strategy. In a large building during rush hour (or any time), an elevator doesn't follow a first come first served strategy. It starts moving in one direction, stopping to pick up and let off passengers until there are no more requests for movement in that direction, then it reverses and does the same thing in the other direction. (There are some strategies that are much more complex than this.)

Similarly, a disk drive using an elevator seek strategy may read (or write) bits and pieces of files without regard to the proper file order as the heads seek in one direction (for example, toward the center of the disk) and then the other. The bits and pieces are stored (or retrieved) from cache until an entire file is present and ready to be processed by the CPU.

Note: This is at least a little oversimplified -- sometimes only pieces of a file are sent to the CPU for processing, and I've glossed over the idea that the cache I'm talking about is usually part of the drive, and not main RAM.


  • RandyKramer - 15 Jan 2002
  • <If you edit this page, add your name here, move this to the next line>
Topic revision: r1 - 2002-01-15 - RandyKramer
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by PerlCopyright 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding WikiLearn? WebBottomBar">Send feedback
See TWiki's New Look