Files
Main/2 Personal/Home Lab/Repairshop/Data Recovery from corrupted Harddisks.md

1.8 KiB

title, created_date, updated_date, aliases, tags
title created_date updated_date aliases tags
Data Recovery from corrupted Harddisks 2025-03-14 2025-03-14

Data Recovery from corrupted Harddisks

Typical Workflow

  1. Clone the disk before file recovery (see this article)
  2. Perform all recovery steps on the clone

Disk Cloning

Using ddrescue

  1. Find the disk on the system We first need to find the disk that we want to clone. We can do this with apps like DiskUtility.app or with the command diskutil list (assuming you are using a mac). Lets assume the faulty drive is /dev/disk3.
  2. Unmount the disk The next step is to unmount the disks: diskutil unmountDisk /dev/disk3
  3. Use ddrescue to clone the disk: First run:
sudo ddrescue -f -n /dev/disk3 /Volumes/Data/valeria_hdd.img /Volumes/Data/valeria_rescue.log
  • -f: makes sure to write to a file and not to a disk
  • -n: skip the scraping and only copy healthy sectors of the disk
  • logfile: very important because it keeps track of what sectors are healthy and which ones are not, meaning we will have more effective consecutive runs.

Second run:

sudo ddrescue -d -r3 /dev/disk3 /Volumes/Data/valeria_hdd.img /Volumes/Data/valeria_rescue.log
  • -d: direct disk access: can help with certain errors
  • -r3: tries to read bad sectors 3 times: meaning it really tries to read them

[!important] Important: keep the image path and the logfile path identical When keeping the paths identical ddrescue will read the logfile and already know where to look for bad sectors. If it succeeds in reading them it will insert the data into the right location of the disk image which is already written.

If everything worked out we should now have a disk image that we can mount on our system and browse the files which are still on there.