Glossary · Operating Systems & Software

Defragmentation (Disk Defrag)

Defragmentation rearranges the scattered pieces of files on a hard disk so each file is stored in contiguous blocks, reducing seek time on mechanical drives.

Updated October 6, 2026

Defragmentation is the process of reorganising data on a storage drive so that the pieces of each file sit next to each other. Over time, saving, deleting and growing files leaves them split into fragments scattered across a hard disk platter.

Why it matters

A mechanical hard disk must move its read head to each fragment, so heavily fragmented files read more slowly. Defragmenting can restore performance on such drives. On solid-state drives there is no moving head, so fragmentation barely affects speed and unnecessary rewriting only adds wear. Modern Windows runs scheduled optimisation automatically and handles SSDs with TRIM instead.

Example

On Windows, open "Defragment and Optimize Drives", select a drive and click Analyze. It reports the percentage fragmented:

C: (NTFS) - 12% fragmented

On an HDD, clicking Optimize defragments it. On an SSD the same button issues a TRIM command, not a defrag. Linux file systems such as ext4 resist fragmentation by design.

Common mistakes

  • Defragmenting an SSD manually with third-party tools.
  • Running it on a nearly full disk, where there is too little free space to rearrange files.
  • Expecting a fast boot from defragging when the real limit is RAM, startup apps or an aging drive.

Get notified when this term updates

Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.

This page is general information written by our editorial team and updated when documentation changes. Servers and providers differ, so test changes safely first. See our editorial policy and disclaimer.