I recently used GNU ddrescue to save a 6TB drive that was having troubles. When I would try to mount the drive, fsck_hfs determined it couldn't be fixed (it was trying to rebuild the catalog b-tree, but then said the disk was full and it couldn't write it). The drive would then mount read-only, and I found that I would get an input-output error if I tried to ls into my Time Machine backup directory. After trying many things that didn't work, I decided to just ddrescue it to a 6TB .dmg, which did work with no bad sectors.

So, now I have a 6TB .dmg image of the drive, and I find that it has the same issues: fsck_hfs thinks it cannot be fixed, and it gives input/output error when trying to ls into the Time Machine directory. I subsequently formatted the external drive, and it seems to be fine, so I think it was never a hardware issue.

I found out that although ls doesn't like the Time Machine directory, rsync seems fine with it. When I try to sync the directory to a new disk with rsync -avhHW --progress <image> <dest>, the output lists all the files I expect, and I can successfully see them appearing on the destination. However, this doesn't seem to work for copying a Time Machine directory, because the size balloons on the destination. rsync used to have --hfs-compression and --protect-decmpfs options, but they seem to be broken in v3.1.3, and as discussed here those may not be enough anyway. Indeed, I find that I've filled a 6TB destination before even making it through half of the directories in the 6TB image.

I am trying to copy the files through Finder now, but it is (understandably) spending ages just preparing. I liked the idea of using rsync not only because it could actually see the files, but because it is ok if interrupted.

So, does anyone know why rsync can see these files when ls can't? Is there any way I can copy them over in a way that is safe to be interrupted but doesn't ruin the hfs+ compression or mess up the hard links (or hard-linked directories, which is what this post claims is the problem with rsync even when it did have the old options)?

Any insight is greatly appreciated.

  • 1
    Since Time Machine has to be on HFS+ have you tried using a third party disk repair utility? My favorite was Diskwarrior but there are others. Sep 20, 2019 at 16:21
  • Welcome to Ask Different and congrats on the clear wording and details in your question. I don't have a good answer for you, but after reading one of the other posts you referenced I started wondering if rsync not supporting hard linked directories was a bug that was being tracked. That led me to bugzilla.samba.org/show_bug.cgi?id=7670 which references differences in behaviour where rsync and Apple's ditto succeeds. So maybe ditto would be useful for you to try here?
    – woolfie
    Sep 20, 2019 at 18:43
  • @SteveChambers I hadn't tried Diskwarrior because it was paid, although I have heard good things. All I have remaining now is the .dmg; the original disk has been formatted. Can utilities like Diskwarrior repair these? Sep 20, 2019 at 19:00
  • @woolfie I may have stumbled on that same thread, because I remember seeing something about ditto. I haven't tried it yet, I will do that next! Thank you. Sep 20, 2019 at 19:01
  • Another thought I had tried earlier was to just expand the .dmg so that fsck_hfs could repair it, since it claimed the issue was a disk full error. Alas, the .dmg created by ddrescue cannot be expanded, so says hdiutil resize -limits. My knowledge of these things is limited, but if there were another way to expand the size of the disk image, it's another thing I would want to try. Sep 20, 2019 at 19:01


You must log in to answer this question.

Browse other questions tagged .