How to Prevent or Repair Hard Drive “Data Rot”

When you have a hard disk connected to your computer, all is good. It periodically checks to be sure all data is secure.

However, when you unplug a hard drive (also called HDD) and store it on a shelf, the magnetized bits that store your data can, over time, lose their charge and its associated data. This process is called “data rot.”

The general rule is that HDDs containing data can be safely stored on a shelf for 3-5 years before problems of data loss or sticky heads (“stiction”) arise. So to prevent problems we need to “reenergize” the data on the disk.

Here’s how.


IMPORTANT NOTE: This requires using Terminal, because I don’t know of an existing utility that does this. This isn’t hard, I’ve run it myself. But, if you are not comfortable using Terminal, get a tech-savvy friend or consultant to help.


NOTE: If the drive does not have an enclosure, use a drive dock (like this Voyager from OWC) to connect it to your computer.

sudo dd if=/dev/r of=/dev/null bs=2048k status=progress

NOTE: In my case, I used: sudo dd if=/dev/rdisk11 of=/dev/null bs=2048k status=progress. That “r” before the name of the drive is important.

Terminal will ask for your password, then display a progress report on the process (red arrow above).

This command reads every sector on the disk – even if the sector is empty and even if it’s not a Mac format disk. Writing is not part of the pass since the drive firmware logic will handle sector reassignments if there are low level questionable reads. The purpose for this is twofold: keep the heads cleared of any parked “stiction” opportunities and validate the sectors on the disk via drive’s the built in block management logic.

This does not erase anything, nor write new data.

NOTE: The “sudo dd” option forces the drive to hit all of the drive’s sectors, not just those specific to any one filesystem/partition.

Most hard disks transfer data between 50 – 250 MB/second. The duration of this re-energizing process depends upon the speed of the drive and the amount of storage to be reviewed. This table can help you calculate the duration.

Time to Process 1 TB of Storage

Hard Drive Speed Hours / TB
50 MB/s 5.5 hours
100 MB/s 2.8 hours
150 MB/s 1.9 hours
200 MB/s 1.4 hours
250 MB/s 1.1 hours

From the table above, multiply the hours per terabyte times the total capacity of your hard drive to get an estimate of how long this will take. If your computer goes to sleep, it will take longer.

EXTRA CREDIT

I’m grateful for the technical assistance of Tim Jones, Chief Solutions Architect at OWC, in providing and verifying the Terminal instructions.


Bookmark the permalink.

24 Responses to How to Prevent or Repair Hard Drive “Data Rot”

← Older Comments Newer Comments →
  1. Thanks, Larry, for this invaluable advice.

    I’m being ultracautious when I need to mess with only-one-copy of contents drives. I signed up to iDrive.com where 5 terabytes of cloud storage cost only $9.95 for the entire first year. (Instead of $99.50).

    Although it’s agonizingly slow, I back up the entire drive into the iDrive cloud before I do anything with the drive’s content. And now, I’ll perform your Terminal function before that.

    BTW: iDrive also provides auto-backup but ignore that as we have Apple’s better Time Machine. So do not download/install the iDrive app.

  2. Larry says:

    David:

    There’s nothing wrong with caution. Remember, you only need to run this Terminal script if the drive is stored on the shelf. If it attached to your computer, the operating system maintains the data.

    Also, if you backup the drive, the process of backing up also re-energizes the data to the copy.

    Larry

  3. Barry Stone says:

    For many years now I have stored ALL my media on an enclosure with 4 spinning drives. The enclosure is set to Raid 0.
    I have two identical 64 TB Raid O enclosures. I clone the two additional Raids to the master once a week or so.

    Before this I had three 20 tb Raid O enclosures.

    So far i have never had any data loss/rot problems. When one of the drives failed (this happened on the 20 tb system), I was able to continue working on the second raid IMMEDIATELY, while I replaced the bad drive, reformatted the raid and updated the media from the third back up to the original newly formatted Raid

    Retrieving any of the media from the cloud, or from (for example) a Raid 5 enclosure, would have held up my work flow by at least a day.

  4. Larry says:

    Barry:

    What you report is perfectly normal. And a great way to backup your data.

    Data rot is only an issue when one ore more drives are unplugged from an enclosure and stored in a shelf. After a few years, dat can start to disappear.

    This is what re-energizing is designed to fix.

    Larry

  5. Jeff Hackbarth says:

    I haven’t used DriveDX for this function yet, but I have been using it for a few years now to monitor some of the other drive health metrics. I haven’t had any drive issues recently, but it’s nice being able to keep an eye on any warnings or potential failures before they happen, in addition to stats like temp and terabytes written.

  6. Tod Hopkins says:

    Update on DriveDX. My issue with drives “interrupting” DriveDX scans appears has been solved by disabling disk sleep (sudo pmset disksleep 0), something I’ve been meaning to do in any case to prevent hard drives from constantly spinning down. The DriveDX SMART scans appear to be faster than the terminal copy. I presume this is because the drive is operating autonomously. Activity Monitor shows no disk activity even though the drive is clearly very active.

  7. Brian Thomas says:

    Hi Larry – Many thanks for all these great tips you share so readily.

    I had a problem using this one with some of my HDDs that show as ‘Container’ between the two lines you show in your examples. Both the top line and the ‘Container’ line show things like disk4 and then, say, disk5 but neither work – typically I get something like “dd: /dev/rdisk5: Operation not permitted”. I could post more complete info but I can’t see how to include screen shots here.

    I greatly appreciate your help and many thanks in advance, Brian.

  8. Larry says:

    Steve:

    Thanks for the link.

    Larry

  9. Larry says:

    Brian:

    I can’t help here as much as I’d like, as Terminal is something I am not proficient in.

    However, when selecting the drive, you need to select the TOP level, the device itself, not the container. Then read the name in the Devices field.

    Larry

← Older Comments Newer Comments →

Leave a Reply

Your email address will not be published. Required fields are marked *

Everything You Need to Know


2,000 Video Training Titles

  • Apple Final Cut Pro
  • Adobe Premiere Pro
  • DaVinci Resolve

Edit smarter with Larry Jordan. Available in our store.

Access over 2,000 on-demand video editing courses. Become a member of our Video Training Library today!


JOIN NOW

Subscribe to Larry's FREE weekly newsletter and
save 10%
on your first purchase.