encyclopegia.org

Defragmentation

In the maintenance of file systems, defragmentation is a process that reduces the degree of fragmentation, files that are stored in multiple segments that are not contiguous on the storage medium. It does this by physically organizing the contents of the mass storage device used to store files into the smallest number of contiguous regions (fragments, extents). It also attempts to create larger regions of free space using compaction to impede the return of fragmentation. Defragmentation is advantageous and relevant to file systems on electromechanical disk drives (hard disk drives, floppy disk drives and optical disk media). The movement of the hard drive's read/write heads over different areas of the disk when accessing fragmented files is slower than accessing the entire contents of a non-fragmented file sequentially without moving the read/write heads to seek other fragments.

In the maintenance of file systems, defragmentation is a process that reduces the degree of fragmentation, files that are stored in multiple segments that are not contiguous on the storage medium. It does this by physically organizing the contents of the mass storage device used to store files into the smallest number of contiguous regions (fragments, extents). It also attempts to create larger regions of free space using compaction to impede the return of fragmentation. Defragmentation is advantageous and relevant to file systems on electromechanical disk drives (hard disk drives, floppy disk drives and optical disk media). The movement of the hard drive's read/write heads over different areas of the disk when accessing fragmented files is slower than accessing the entire contents of a non-fragmented file sequentially without moving the read/write heads to seek other fragments. ===Partitioning=== A common strategy to optimize defragmentation and to reduce the impact of fragmentation is to partition the hard disk(s) in a way that separates partitions of the file system that experience many more reads than writes from the more volatile zones where files are created and deleted frequently. The directories that contain the users' profiles are modified constantly (especially with the Temp directory and web browser cache creating thousands of files that are deleted in a few days). If files from user profiles are held on a dedicated partition (as is commonly done on UNIX recommended files systems, where it is typically stored in the /var partition), the defragmenter runs better since it does not need to deal with all the static files from other directories. (Alternatively, a defragmenter can be told to simply exclude certain file paths.) For partitions with relatively little write activity, defragmentation time greatly improves after the first defragmentation, since the defragmenter will need to defragment only a small number of new files in the future. ===Solid-state disks=== When reading data from a conventional electromechanical hard disk drive, the disk controller must first position the head, relatively slowly, to the track where a given fragment resides, and then wait while the disk platter rotates until the fragment reaches the head. A solid-state drive (SSD) is based on flash memory with no moving parts, so random access of a file fragment on flash memory does not suffer this delay, making defragmentation to optimize access speed unnecessary. Furthermore, since flash memory can be written to only a limited number of times before it fails, defragmentation is actually detrimental (except in the mitigation of catastrophic failure). However, Windows still defragments an SSD automatically (albeit less vigorously) to prevent the file system from reaching its maximum fragmentation tolerance (when the metadata can’t represent any more file fragments). Once the maximum fragmentation limit is reached, subsequent attempts to write to disk fail. ==Approach and defragmenters by file-system type== FAT: MS-DOS 6.x and Windows 9x-systems come with a defragmentation utility called Defrag. The MS-DOS version is a limited version of Norton SpeedDisk. The version that came with Windows 9x was licensed from Symantec Corporation, and the version that came with Windows 2000 and XP is licensed from Condusiv Technologies. NTFS was introduced with Windows NT 3.1, but the NTFS filesystem driver did not include any defragmentation capabilities. In Windows NT 4.0, defragmenting APIs were introduced that third-party tools could use to perform defragmentation tasks; however, no defragmentation software was included. In Windows 2000, Windows XP and Windows Server 2003, Microsoft included a defragmentation tool based on Diskeeper that made use of the defragmentation APIs and was a snap-in for Computer Management. In Windows Vista, Windows 7 and Windows 8, the tool has been greatly improved and was given a new interface with no visual diskmap and is no longer part of Computer Management. There are also a number of free and commercial third-party defragmentation products available for Windows. BSD UFS and particularly FreeBSD uses an internal reallocator that seeks to reduce fragmentation right in the moment when the information is written to disk. This effectively controls system degradation after extended use. Btrfs has online and automatic defragmentation available. Linux ext2, ext3, and ext4: Much like UFS, these filesystems employ allocation techniques designed to keep fragmentation under control at all times. As a result, defragmentation is not needed in the vast majority of cases. ext2 uses an offline defragmenter called e2defrag , which does not work with its successor ext3. However, other programs, or filesystem-independent ones such as defragfs , may be used to defragment an ext3 filesystem. ext4 is somewhat backward compatible with ext3, and thus has generally the same amount of support from defragmentation programs. Currently e4defrag can be used to defragment an ext4 filesystem, including online defragmentation. VxFS has the fsadm utility that includes defrag operations. JFS has the defragfs utility on IBM operating systems. HFS Plus introduced in 1998 with Mac OS 8.1 has a number of optimizations to the allocation algorithms in an attempt to defragment files while they are being accessed without a separate defragmenter. There are several restrictions for files to be candidates for 'on-the-fly' defragmentation (including a maximum size 20MB). There is a utility, , by Coriolis Systems available since OS X 10.3. On traditional Mac OS defragmentation can be done by Norton SpeedDisk and TechTool Pro. WAFL in NetApp's ONTAP 7.2 operating system has a command called reallocate that is designed to defragment large files. XFS provides an online defragmentation utility called xfs_fsr . SFS processes the defragmentation feature in almost completely stateless way (apart from the location it is working on), so defragmentation can be stopped and started instantly. ADFS, the file system used by RISC OS and earlier Acorn Computers, keeps file fragmentation under control without requiring manual defragmentation. ==See also== Comparison of defragmentation software Fragmentation (computing) File system fragmentation Virtual disk image Wear leveling, a similar technique for prolonging flash memory content ==Notes== ==References== ==Sources== Norton, Peter (1994) Peter Norton's Complete Guide to DOS 6.22, page 521 – Sams ( ) Woody Leonhard, Justin Leonhard (2005) Windows XP Timesaving Techniques For Dummies, Second Edition page 456 – For Dummies ( ). Jensen, Craig (1994). Fragmentation: The Condition, the Cause, the Cure. Executive Software International ( ). Dave Kleiman, Laura Hunter, Mahesh Satyanarayana, Kimon Andreou, Nancy G Altholz, Lawrence Abrams, Darren Windham, Tony Bradley and Brian Barber (2006) Winternals: Defragmentation, Recovery, and Administration Field Guide – Syngress ( ) Robb, Drew (2003) Server Disk Management in a Windows Environment Chapter 7 – AUERBACH ( ) ==External links== The Big Windows 7 Defragmenter Test Benchmarks of popular defrag utilities Microsoft Windows XP defragmentation - How to schedule a weekly defragmentation SST Hard Disk Optimizer How Linux avoids making files fragmented How defragmentation was changed for Windows 7 Complete list of Defragmentation Utilities for Windows Does Your SSD's File System Affect Performance? de:Fragmentierung (Dateisystem)#Defragmentierung in Betriebssystemen

References

No reference rows published for this article.

Cite this article

MLA

"Defragmentation." encyclopegia.org, 2026, https://encyclopegia.org/wiki/defragmentation. Accessed 24 November 2026.

Chicago

"Defragmentation." encyclopegia.org. Accessed November 24, 2026. https://encyclopegia.org/wiki/defragmentation.

APA

encyclopegia.org. (2026). Defragmentation. Retrieved November 24, 2026, from https://encyclopegia.org/wiki/defragmentation

Accessed November 24, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

comparison of defragmentation software

stub · references available

Défragmentation

stub · references available

Contig (defragmentation utility)

enwiki · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1371959843 · 0.5 · snapshot enwiki-001371959843

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.