I am trying to recover files from a disk that has hardware errors.

The disk was repaired by disk utility, but it told me that the disk is damaged, so I need to backup everything before a failure will happen.

So I tried to copy the files via finder, but it gets stuck. Tried other utilities and they get stuck trying to copy the files, when the head hits the damaged block.

So I tried with rsync, and it seems to work; but it takes forever when I hit a bad block.

So I was wondering, if there is a way to tell Rsync to not even bother with a file, if it takes too long?Either I can specify the number of try with each file, or how long it needs to try for each file?

I am not sure how long this drive will last honestly, so I want to get all the data off ASAP, while I can still mount it and see the data on it in finder.

This is what I am using as command; please advice if there is any way to reduce the try on a file, so I can have rsync to try to read the damaged blocks, but avoid to get stuck on a specific sector for too long.

rsync -arv -e--ignore-errors --partial-dir=/Volumes/backup/partial /Volumes/work /Volumes/backup

Thanks in advance.

  • 3
    If the drive has damaged sectors you are better of trying to image the drive with something like dd_rescue, it has advanced features to cope with bad sectors.
    – jmreicha
    Apr 17, 2013 at 13:46
  • I think @jmreicha has the right idea, but in the future, if you have rsync technical questions, friendly gurus are available on the rsync list: lists.samba.org/mailman/listinfo/rsync
    – Joe
    Apr 23, 2013 at 22:11

2 Answers 2


Short answer: rsync it is not the right tool to be used in this case: its use can be even harmful.
Use ddrescue instead (better than dd_rescue). It is able to do what you are asking for.

If the disk is physically damaged, there is the possibility to brick it with any attempt to repair it.

It is not only a question about the use of your time, when rsync seems to hang forever approaching a damaged sector. The problem is that with repeated operations an irreparable failure can happens, and then you will be not anymore able to to rescue your data without expensive parts replacement (always if it will be still possible and you will not have bricked your HDD).

In this case the most safe procedure I found is

  1. To create a raw image on another not broken disk.
  2. To create a copy of that image.
  3. To work on the copy to fix the filesystem and to rescue the files.

Why the copy? Because if it fails something in the filesystem fixing step you can always start again without the need to touch again the original damaged HDD.

I suggest you to use ddrescue, to do the raw disk image, defects included, because it works fine even in case of read errors.

How to do it with ddrescue

You can use ddrescue exactly as you would like to use rsync, skipping the damaged sectors without retrying or splitting them, copying as much data as possible.
This command is here below (instead of /dev/hda1 you will put your device):

ddrescue --no-split /dev/hda1 imagefile logfile

After that you have done this first passage (the faster one), you can try to refine it trying to access for 3 times in case of error.

ddrescue --direct --max-retries=3 /dev/hda1 imagefile logfile 

You can continue to refine the image repeating the ddrescue command invocations with other options, trying each time to extract more data (see the references). When you will finish you can create the copy (if you have all the needed space) and then to fix the filesystem.

Note that the raw image will be as big as the original HDD.
You can find on internet, on this and on other sites of StackExchange many questions&answers about how to rescue data with ddrescue or other tools.


  • indeed dd_rescue is the way to go. I had it in my original reply, 2 years ago; but for some reasons someone decided that I could not answer my own question :) Thanks for the reply and awesome details
    – rataplan
    Oct 6, 2015 at 23:16
  • @newbiez: Instead I had a serious disk problem with my almost bricked main HDD... so I met ddrescue and its friends :-) About your answer only a word: weird... post it again and if someone will try to close again I will vote yes to reopen (I never used that new power :D)
    – Hastur
    Oct 7, 2015 at 7:23
  • 2
    The --no-split option was removed in newer versions of ddrescue. Use --no-scrape instead. See lists.gnu.org/archive/html/bug-ddrescue/2015-09/msg00001.html
    – Grmpfhmbl
    Mar 11, 2017 at 23:49

I found this topic while was searching for a solution to save data from a failing SD-card (Ubuntu 20.04).

The answer of Hastur is awesome although the commands don't work for me on Ubuntu 20.04.

Based on Grmpfhmbl comment and ddrescue --help

  • the --no-split flag was removed so can use --no-scrape instead

    -n, --no-scrape skip the scraping phase

ddrescue --no-scrape /dev/hda1 imagefile logfile

And the command to refine has changed, too.

  • use -d or --idirect for direct disk access for the input file

    -d, --idirect use direct disc access for input file

  • instead of --max-retries=3 we can use -r or --retry-passes=<n>

    -r, --retry-passes= exit after retry passes (-1=infinity) [0]

ddrescue --idirect --retry-passes=3 /dev/hda1 imagefile logfile 

I assume no credit for this post, it's just an update of the answer of Hastur.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .