Remember defragging your drive? Why it's not a thing anymore - ZDNET

Remember defragging your drive? Why it’s not a thing anymore

Defragging your drive was once a ritual. It largely got left in the past, but there are exceptions worth knowing.

Taylor Clemons

Staff Writer

Taylor Clemons is a tech writer and reviewer based near Cleveland, OH.… Read full bio
Open hard disk drive platter with actuator arm technology background.
Cholada Hongsaeng via iStock / Getty Images Plus

ZDNET’s key takeaways

  • Your drive type matters when deciding whether to defrag.
  • Modern storage has changed the rules of routine PC maintenance.
  • Before you defrag, know what it could mean for your drive.

When my family got our first home computer in the mid-90s, I vividly remember my father drilling into us the importance of defragging the hard drive at least once a week to keep it running smoothly. The advice stuck with me through high school and well into college, when I got my hands on my first USB flash drives and was eyeing the then-brand-new SSD technology that promised previously unheard-of read/write speeds and better storage potential.

Also: How to optimize storage on your MacOS device

What does defragging mean?

Defrag, short for “defragmentation,” is a process your computer can initiate to reorganize and streamline how data is stored on your hard drive.

In the early days of home computing, the hard-disk drive was king since it was relatively cheap to produce. But the drawback was that having both physical moving parts and a now almost archaic form of data storage meant that your computer was much more prone to slowdowns due to files being scattered in random sectors across your disk. And since this was before the age of the internet and automation, you would have to periodically run a manual disk defrag to free up potential space and speed up your desktop.

A hard-disk drive also reads and writes files at different speeds depending on what section of the platter they’re physically written to. Typically, sectors closer to the center of the platter have slower read and write speeds, which can cause data bottlenecks when trying to load large files like videos or games. Thankfully, modern defrag programs not only reorganize your data but also optimize your drive for modern operating systems and programs. This means that larger, more important files will more likely be stored on the outer edge of the platter for faster load times, while smaller documents will shift toward the center.

Also: I’ve tested over 100 drives and their speeds with this free tool

While it’s still a good idea to keep an eye on your storage drive’s general health with a program like CrystalDiskMark, modern hard-disk drives have benefited from breakthroughs in storage technology over the past decade or so, making them much more efficient and less prone to slowdowns as well as physical damage from drops and shocks. An occasional defrag is still a good housekeeping practice if you’re using an aging drive on an older version of Windows, MacOS, or Linux, but it’s not wholly necessary to the performance of your computer.

Do solid-state drives need to be defragmented?

A solid-state drive uses an entirely different method of data storage than a traditional HDD.

If you think of a hard-disk drive as a turntable, reading data from grooves on a disc with a highly sensitive needle, an SSD is more like an iPod, storing data digitally in specialized chipsets that operate similarly to USB flash drives. Since SSDs use NAND flash memory, they utilize a series of logic gates to locate, read, and write data rather than a physical planchet moving over a data platter, making them much, much faster than their elder HDD cousins. They’re also much more stable since they eschew moving parts for static chipsets, so you don’t have to worry about a little knock ruining your entire backup drive.

However, the solid-state drive’s biggest drawback is its finite lifespan. Theoretically, a traditional HDD kept in good condition can write and overwrite data almost indefinitely, as long as there isn’t any damage to the physical parts. An SSD has something called a data storage tolerance, which is how much data can be written and overwritten onto it over a lifetime of use. This number is typically in the thousands, so unless you’re a very productive (or very fickle) person, you likely won’t ever come close to reaching your SSD’s tolerance limit.

Also: Stop buying cheap SSDs and other storage drives

That being said, the defragging process counts against that limit, which can lead to premature drive failures and data corruption. If your SSD is experiencing significant slowdowns, you likely have an optimization issue rather than a fragmentation problem.

How often should you defrag an HDD?

It really depends on the age of your hard drive.

Also: Why I switched to a NAS storage drive to backup files

If you’ve bought a new HDD within the last five years or so, you’ll likely never have to run a scheduled defrag for maintenance. However, if you have a retro hobby machine you’re trying to keep within the realm of the living, modern operating systems let you set a regular schedule for defragmentation and let it quietly run in the background for hands-off maintenance of that old college media drive or external HDD full of family photos.

Set-and-forget

Setting up a regular defragmentation schedule for your hard drive is a fairly straightforward process on Windows and MacOS, but Linux is a bit more involved:

Windows

  • Search bar > Defragment and Optimize Drives > Scheduled optimization > Change settings > Check “Run on a schedule” > Set daily/weekly/monthly > Check “Increase task priority, if three consecutive scheduled runs are missed” > Choose drive. This can be done for multiple internal and external hard drives to keep your entire setup healthy.

MacOS (HDD only)

The Mac operating system doesn’t have a native application for hard-disk defragmentation, but the popular program iDefrag offers a solution for anyone trying to squeeze a bit more life out of a previous-gen MacBook or desktop. Just download the program, upload the license photo, find your drive, and defrag.

Also: I ditched Google Drive for my own self-hosted storage

Linux

Defragmentation on most Linux distros requires a bit more of a time commitment and a lot more knowledge of your operating system’s file storage logic:

  • Unmount partition: $ umount <devicefile>
  • Run command: # e2fsck -fn <devicefile>
  • Extract details on degree of fragmentation: # dumpe2fs <devicefile>
  • If your drive is 20% or more fragmented, proceed
  • Root command: # filefrag <file>
  • Copy data from the affected partitions to a clean disk
  • Delete original data paths
  • Re-copy data back to your hard drive
  • Unpack defragfs to a folder
  • Copy program to /usr/local/bin
  • Launch tool with administrative command: # defragfs <directoryname> -a
  • Wait for the tool to complete defragmentation

Can you defrag a USB flash drive or SD card?

Like SSDs, USB drives and SD cards use a type of flash memory to digitally store information for faster retrieval and more reliable long-term storage. And just like SSDs, flash drives and SD cards have memory tolerance limits that can be significantly reduced by running defragmentation programs. If your USB thumb drive or SD card is having speed and retrieval issues, it’s easier and cheaper to simply replace it with newer and more efficient storage options.