0

I created an "emergency" image of my dying HD using the procedure explained in Recover a dead hard drive using dd.

Now when I try to mount the dmg file I get the message: "The following disk image couldn't be opened... no mountable files"

How can I mount the image and explore the directories and files?

2
  • What was the exact command you used to create the dd image and what OS/Filesystem was on the source drive? Commented Dec 24, 2015 at 2:21
  • As in the link, I used dd bs=512 if=/dev/disk0 of=/External_HD/foo.dmg conv=noerror,sync. The OS was Yosemite. Commented Dec 24, 2015 at 2:32

1 Answer 1

1

I've gotten shafted doing a similar rescue using dd. I doubt this will help, but it's worth a shot: How to Repair DMG Files. Another comment on there reported success opening a problematic dd created image using filesavage, seems kinda dated and pricey for a maybe.

I don't know if your drive is still alive or not, if you can do another rescue run with different software, that would probably be your best bet.

In the comments on the webpage you linked to, there were suggestions of using ddrescue, a worthwhile read here before you go down that road and it might explain why your (and my) dd backup did not work.

You can easily install the current version of ddrescue if you have macports installed sudo port install ddrescue. Failing that, If you have xcode installed, it's trivial to download the latest source code, browse to download in terminal, extract lzip -dc /PathTo/ddrescue.tar.lz | tar -x, cd to extracted ddrescue directory, then make and sudo make install. If not, another alternative is the this ddrescue-gui that I came across, it has ddrescue bundled within the application, you'll want to download the .dmg version. This might be an easy way to go, but you lose the power of log files (you can merge multiple partial recovered images).

I've used testdisk/photorec in the past with some success, it got some of my files but not all of them, and it was not organized at all by the way, many duplicates. I'd try ddrescue or ddrescue-gui out if I were you, if you want to do the free & command line route. As always, read the manual, it's got some good practices as far as best recovery practices. Dated Mac OSX hints entry

Seek and ye shall find. Best of luck, let me know if you need help with anything.

5
  • Thank you @adamlogan for the great answer! Unfortunately I was not able to use ddrescue because the disk wouldn't star up, so I used dd in the terminal available from the recovery disk. I was able to recover some of my files mounting the disk image using 7zip in a windows machine. Thanks again! Commented Dec 29, 2015 at 13:06
  • Do you know where I can find my .bashrc file in the dd image? Commented Dec 29, 2015 at 13:07
  • Gotcha. This is why making a bootable mac osx partition on an external hard drive or very large thumb drive is a great idea, you can put tools like ddrescue, testdisk etc some gui tools and others onto it that the rescue partition does not provide. Would be cool if we could modify the rescue partion, I reckon it could be done, but it gets updated so any work may be undone. As far as the .bashrc I have no idea. I looked on my system and didn't see one anywhere. I'd be surprised if it wasn't in the home folder though? I use a .profile for my shell. Commented Dec 30, 2015 at 3:32
  • Why does this have to be so complex... !!!!!! Commented Aug 13, 2020 at 16:54
  • @basZero I empathize, and agree as a novice power-user. This is and advanced topic though. If it's really important to you, maybe consider paying a professional to do this service. Commented Aug 14, 2020 at 22:25

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.