Skip to main content

How to recover your data from a dead partition on macOS

Data loss sucks. Data loss without a backup really sucks. I recently had to restore some archived data that I had "responsibly" stored on a redundant storage backup device called a Drobo (opens in new tab) that unfortunately for me, decided to have an HFS+ filesystem partition failure. I could see the Drobo in my Disk Utility, but I could not see the 8 TB partition with my archived data. Yikes.

Luckily, I used some recovery tools, both free and paid, to not only fix my partition, but to also get my data back onto another redundant networked attached storage array called a Synology Diskstation (opens in new tab). Here's how!

Don't touch anything!

First rule about data recovery and fixing disk partitions is that you do NOT want to make any changes to the environment, the disk in question, the partition, etc. Well, not until at the very least you can assess that the device truly has a damaged partition. I can't say how many times someone has come to me to recover a partition or data, only to find out that a forced disk check, copying new files to the partition, or switching to a new machine has caused permanent unrecoverable damage to the files. It's very important to assess the situation as prudently as possible before acting. In fact, I even advise against powering down the system unless absolutely necessary.

I have a broken partition, now what?

Once you've determined that you are in a situation that you need special tools to be able to recover your partition and data, then you'll need to decide how you want to proceed by choosing from the type of recovery tools available.

There are free and open source tools that, with a tiny bit of getting your hands dirty in a terminal, will get your partition back up to a point where it will either be fixed or be put in a position where you'll be able to copy your data off and reformat your disk.

There are also utilities that give you a nice graphical interface that makes recovery of data as painless as possible, for a fee. Many of them allow you to download the product for free to see if the program will be able to detect any partitions or data before you buy and then unlock the necessary components to actually allow you to get your data.

We'll show you examples of each but no matter the method you choose, neither will be as costly as paying a professional to recover your data.

Testdisk and Photorec

For our free and open source options, I used TestDisk and Photorec. These program work in tandem to give you a full recovery suite that non-free programs provide. Both applications are part of a single download.

Testdisk

Testdisk is a powerful partition table recovery software. It can get your partition to the state that, at the very least, will make it visible to the OS so that you can copy off your data or, even better, fix the partition to become fully functional once again.

  1. Download Testdisk.
  2. Extract the zip file in Finder.
  3. Open terminal.
  4. Navigate to the Testdisk directory, typically ~/Downloads/testdisk-VERSION_NUMBER.
  5. Start test disk with the ./testdisk terminal command.
  6. Create a new log file for recovery.
  7. Enter your password when prompted and press return.
  8. Select the physical disk that you need to have the partition repaired and press return. You can use disk utility to find out the disk name in the form of Device: disk1.

  1. Select your partition type to recover. Testdisk will try to autodetect the partition as well.
  2. Select analyze and press return.

Testdisk will now try and read the data on the disk, detect the partition type and geometry from a few of the files it finds and try to suggest a new "fixed" partition table.

If Testdisk can find a damaged partition successfully, it will be listed.

  1. Highlight your partition.
  2. Highlight Write to rewrite a new partition table.

  1. Press "Y" to Confirm.
  2. Press OK.
  3. Quit Testdisk.
  4. Reboot your computer.

Photorec

That was enough for me to get back at my data to copy it all off and reformat the drive. However, sometimes Testdisk might not be able to fix your partition table. That's where Photorec comes in. As described, Photorec ignores the file system; this way it works even if the file system is severely damaged.

  1. In the same working directory for Testdisk, start Photorec with the ./photorec command.
  2. You'll get a similar menu selection as in Testdisk. Select your the physical disk for the partition you want to recover from.
  3. Photorec will analyze the drive and attempt to find a partition. If the partition is in very bad shape, it may find multiple instances. You'll need to Search from each.
  4. Photorec will request a location to copy your files to. Make certain you have enough space.
  5. Photorec will start the very long and slow process of recovering your files.

The major drawback of Photorec is that due to how deeply the program scans the drive, the process is very slow. However, it is very effective.

Data Rescue and Disk Drill

If you're not wanting to fiddle in the command line or would prefer an easy to use click and go recovery option then you might prefer the paid options. These programs are easy to install and are straightforward in their usage. Simply, install, run, point to your drive, scan, recover. Done.

Both Data Rescue 5 and Disk Drill offer try before you buy functionality. In each program, you'll be able to scan your failed drive to search for partitions. In each, you'll be able to determine if either program is even able to see the data you need to recover. Once you're satisfied that your data is there and recoverable, you can restore your data by enabling the paid content by buying a license. Data Rescue 5 (opens in new tab) retails for around $99. Disk Drill retails for around $89 for a single device. More devices cost extra. Both were able to see my borked partition and were able to recover my files.

Conclusion

Having backups of backups or off-site backups would have avoided this situation entirely. Ultimately that's the best remedy. It used to be that your only recourse was to bring your hardware into a specialist that would recover your data for hundreds of dollars. Although not ideal, at the very least, you can now do your own recovery on your macOS device for a fraction of the price, or even for free. Have a recovery success story? Tell us in the comments!

4 Comments
  • You really should have a caveat right at the beginning... Trying to do your own data recovery could make a recovery impossible for a professional data recovery service. There are many reasons a partition could be bad...some minor some major. So right from the beginning, you need to ask yourself, how important is this data? If it's something you're ok loosing (downloaded music or movies, etc.)...give DIY a try. If it's something critical that you can't loose (data that can't be recreated or that would take many hours to recreate)...turn it off, and give the pros a call.
  • Admittedly the pros will be doing the same techniques as on this article, but you're right you do need to be careful in this scenario, as any further writes to the hard drive could limit your chances of getting the data you want back. In any case, the best thing to do is to avoid this situation all together and backup your data, it's hard to believe it's 2019 and people are still not backing up important files.
  • The real danger is if the failed drive had media damage... bad actuator, etc. ... You could be literally scraping the data off the platter. If your data is important, I wouldn't risk it.
  • A co-worker had a 24TB RAID 5 go down. One single bad drive. Pulled the drive out and put a new one in, but it didn't rebuild. So all the drives went off to the pros. $7,000 later, he had his data back. All for just the Project files for Final Cut, which are actually very small files. He hadn't bothered to back them up elsewhere. Over 20 years of videos down the tube. You can imagine that high price was worth it. But his boss wasn't too pleased. He had the same RAID model, with the same drives (we found out those drives were notoriously bad). So don't trust raids to be your backup! And we are all running our RAIDS at RAID 6 now, to reduce the failure risk. As for the software mentioned, I'm going to get them both. I'm something of a aficionado of such software. And you mention Disk Drill. I have the Pro version and it's amazing software. And it includes the best duplicate finder I've used to date for my Mac. It's really basic, but deadly accurate and functional. I'm combing through 9TB of images from the last 15 years of shooting. (Film before that.) Data Rescue actually comes on some SD and CF cards of the pro kind with a serial number. It's also very, very slow, but will find stuff if it's still on those tiny cards.