Defragment and Optimize Drives (dfrgui.exe)


Fragmentation

On a hard disk, ideally each file would be saved in contiguous clusters on the disk.
In practice, over time as files grow, they become fragmented across non-contiguous clusters, reducing read performance.

The Defragment and Optimize Drives tool (dfrgui.exe) runs various operations to speed up the performance of HDDs and SSDs:

  • On an HDD:
    • defragmenting rewrites file data so that it occupies contiguous clusters, reducing the amount of time the controller has to seek over the disk to read a file
  • On an SSD:
    • data is stored in units called blocks that are not directly managed by the OS
    • drive controller determines how blocks are used according to wear-leveling routines to minimize degradation of the solid-state cells
    • main purpose of the optimizer tool is to instruct the controller to run a TRIM operation
      • TRIM is a process by which the controller identifies data that the OS has marked as deletable and can then tag corresponding blocks as writable
    • optimizer does perform a type of defragmentation operation on an SSD if it holds the OS and the system protection feature Volume Shadow Copy service is enabled