IT lexicon › Infra & Ops › Defrag command

Defrag command

Infra & Ops På svenska → Updated: 2026-11-17

System utility that reorganizes file blocks to reduce fragmentation and improve disk seek performance.

As filesystems age, files become fragmented—a file starting at block 100 may grow by allocating blocks 5000, 1000, and 50 scattered across the disk. Defragmentation tools (e.g., e4defrag on Linux, Windows Defrag on NTFS) read fragments, write them contiguously, and update the inode. Modern filesystems prevent fragmentation via extent-based allocation and intelligent block grouping.

Defragmentation is nearly obsolete in the SSD era. SSDs have no seek time, and defrag reduces TRIM efficiency and shortens flash lifespan. Even older hard drives rarely benefit from defrag today—most are hyperscale storage arrays with their own optimization strategies.

← Back to the lexicon