Defragmentation

In the context of administering computer systems, defragmentation (or defragging) is a process that eliminates fragmentation in file systems. It does this by physically reorganizing the disk's contents in order to store the pieces of each files close together and in order (contiguously). It also attempts to create large regions of free space using compaction, to impede the return of fragmentation.

Contents

Aims of defragmentation

Reading and writing data on a heavily fragmented hard drive is slowed down as the time for the heads to move between fragments on the disk surface can be substantial. The disk operates at speeds millions of times slower than the CPU; thus the desire to process more efficiently encourages defragmentation. Operating system manufacturers often recommend periodic defragmentation in order to keep hard drive access as fast as possible.

Fragmented data also spreads over more disk than it needs. Thus one may defragment in order to compact data storage before splitting a single partition into two or more partitions (for example, with FIPS, or PartitionMagic).

Causes and cures

Fragmentation occurs when the operating system cannot or will not allocate enough contiguous space to store a complete file as a unit, but instead puts parts of it in gaps between other files (usually those gaps exist because they formerly held a file that the operating system has subsequently deleted or because the operating system allocated excess space for the file in the first place). As advances in technology bring us larger disk drives, the performance loss due to fragmentation squares with each doubling of the size of the drive. Larger files and greater numbers of files also contribute to fragmentation and consequent performance loss. Defragmentation restores a drive to its original speed.

[Source: Jensen, Craig (1994). Fragmentation the Condition, the Cause, the Cure. Executive Software International. ISBN 0-9640049-0-9.]

A defragmentation program must move files around within the free space available in order to undo fragmentation. This is a memory intensive operation and cannot be performed on a filesystem with no free space. The reorganization involved in defragmentation does not change logical location of the files (defined as their location within the directory structure).

Defragmentation issues

The presence of immovable system files (or of files that the defragmenter will not move in order to simplify its task), especially a swap file, can impede defragmentation. ntfsresize can safely move these files in order to resize an NTFS partition.

Certain file systems exhibit a greater susceptibility to fragmentation than others, for example, a FAT file system becomes fragmented much more quickly than NTFS. Many file systems on Unix-like platforms, such as ext3 and xfs do not provide the ability to explicitly defragment at all. These systems attempt to keep fragmentation below a certain point so defragmenting is not necessary. This fragmentation resistance works well as long as the file system has a fairly large amount of space free.

On systems without fragmentation resistance, fragmentation builds upon itself when left unhandled, so daily defragmentation is necessary to keep disk performance at peak and avoid the excess overhead of less frequent defragmentation.

Utilities

Missing image
Windows_XP-Disk_Defragmenter.png
Microsoft Windows XP Disk Defragmenter.

Defragmentation programs often come bundled with an operating system (although Windows NT 4 notably did not include one).

Perhaps the best-known defragmentation utility is the MS-DOS and Windows program DEFRAG. It can be accessed in modern versions of Windows as "Disk Defragmenter", found on the Accessories -> System Tools folder of the Start Menu.

With the reiser4 filesystem, defragmentation is activated by executing the following line:

echo 1 >/sys/fs/reiser4/*/repacker/startde:Defragmentierung
Navigation

  • Art and Cultures
    • Art (https://academickids.com/encyclopedia/index.php/Art)
    • Architecture (https://academickids.com/encyclopedia/index.php/Architecture)
    • Cultures (https://www.academickids.com/encyclopedia/index.php/Cultures)
    • Music (https://www.academickids.com/encyclopedia/index.php/Music)
    • Musical Instruments (http://academickids.com/encyclopedia/index.php/List_of_musical_instruments)
  • Biographies (http://www.academickids.com/encyclopedia/index.php/Biographies)
  • Clipart (http://www.academickids.com/encyclopedia/index.php/Clipart)
  • Geography (http://www.academickids.com/encyclopedia/index.php/Geography)
    • Countries of the World (http://www.academickids.com/encyclopedia/index.php/Countries)
    • Maps (http://www.academickids.com/encyclopedia/index.php/Maps)
    • Flags (http://www.academickids.com/encyclopedia/index.php/Flags)
    • Continents (http://www.academickids.com/encyclopedia/index.php/Continents)
  • History (http://www.academickids.com/encyclopedia/index.php/History)
    • Ancient Civilizations (http://www.academickids.com/encyclopedia/index.php/Ancient_Civilizations)
    • Industrial Revolution (http://www.academickids.com/encyclopedia/index.php/Industrial_Revolution)
    • Middle Ages (http://www.academickids.com/encyclopedia/index.php/Middle_Ages)
    • Prehistory (http://www.academickids.com/encyclopedia/index.php/Prehistory)
    • Renaissance (http://www.academickids.com/encyclopedia/index.php/Renaissance)
    • Timelines (http://www.academickids.com/encyclopedia/index.php/Timelines)
    • United States (http://www.academickids.com/encyclopedia/index.php/United_States)
    • Wars (http://www.academickids.com/encyclopedia/index.php/Wars)
    • World History (http://www.academickids.com/encyclopedia/index.php/History_of_the_world)
  • Human Body (http://www.academickids.com/encyclopedia/index.php/Human_Body)
  • Mathematics (http://www.academickids.com/encyclopedia/index.php/Mathematics)
  • Reference (http://www.academickids.com/encyclopedia/index.php/Reference)
  • Science (http://www.academickids.com/encyclopedia/index.php/Science)
    • Animals (http://www.academickids.com/encyclopedia/index.php/Animals)
    • Aviation (http://www.academickids.com/encyclopedia/index.php/Aviation)
    • Dinosaurs (http://www.academickids.com/encyclopedia/index.php/Dinosaurs)
    • Earth (http://www.academickids.com/encyclopedia/index.php/Earth)
    • Inventions (http://www.academickids.com/encyclopedia/index.php/Inventions)
    • Physical Science (http://www.academickids.com/encyclopedia/index.php/Physical_Science)
    • Plants (http://www.academickids.com/encyclopedia/index.php/Plants)
    • Scientists (http://www.academickids.com/encyclopedia/index.php/Scientists)
  • Social Studies (http://www.academickids.com/encyclopedia/index.php/Social_Studies)
    • Anthropology (http://www.academickids.com/encyclopedia/index.php/Anthropology)
    • Economics (http://www.academickids.com/encyclopedia/index.php/Economics)
    • Government (http://www.academickids.com/encyclopedia/index.php/Government)
    • Religion (http://www.academickids.com/encyclopedia/index.php/Religion)
    • Holidays (http://www.academickids.com/encyclopedia/index.php/Holidays)
  • Space and Astronomy
    • Solar System (http://www.academickids.com/encyclopedia/index.php/Solar_System)
    • Planets (http://www.academickids.com/encyclopedia/index.php/Planets)
  • Sports (http://www.academickids.com/encyclopedia/index.php/Sports)
  • Timelines (http://www.academickids.com/encyclopedia/index.php/Timelines)
  • Weather (http://www.academickids.com/encyclopedia/index.php/Weather)
  • US States (http://www.academickids.com/encyclopedia/index.php/US_States)

Information

  • Home Page (http://academickids.com/encyclopedia/index.php)
  • Contact Us (http://www.academickids.com/encyclopedia/index.php/Contactus)

  • Clip Art (http://classroomclipart.com)
Toolbox
Personal tools