Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Alright, you'll have to forgive that I don't have an abundance of knowledge with using these tools. I've tried to follow the tips provided in this thread:

How to mount a HFS partition in Ubuntu as Read/Write?

And experimented with mounting using '-o loop' to no avail. It was also mentioned that I may need to determine the starting sector, but I can't seem to get that information.

My friend had a harddrive from an iMac that she thought was corrupted, and I was able to make a copy using dd to an image on my harddrive. I believe I copied only one partition, but possibly the entire drive? I actually don't remember since it was a while ago. So now I've got this image sitting on my machine that supposedly has a whole bunch of files in it I can't access.



Should mention that this is the error I get when attempting to mount:

mount: wrong fs type, bad option, bad superblock on /dev/loop0,
   missing codepage or helper program, or other error

   In some cases useful info is found in syslog - try
   dmesg | tail or so.
share|improve this question

Notice: dd reads and writes raw data with disregard to files, file systems, partition types, etc. Because of this, any error, any missing data can make the image worthless since the filesystem may not be intact. This is of particular importance if a harddrive is dying, there will be I/O errors which can make a dd image useless. Always verify backups. DD images are particular easy to verify, they are [usually] "all or nothing".

  1. Make sure the hfsprogs package is installed. You also need the kpartx package for the second option.

  2. Don't worry about journaling and mounting as r/w, since you do not want to write to the backup.

  3. You need to be root to run these commands (i.e. use sudo -i)

If the data is intact and ...

The image is a single partition:

mkdir -p /mnt/imac
mount /path/to/image /mnt/imac
ls /mnt/imac

The image contains a partition table

Create device maps:

kpartx -l "$image"
list=$(kpartx -l "$image" | grep -v "deleted" | awk '{print $1}');     
kpartx -a -v "$image"

Mount loopbacks:

IFS=$(echo -en "\n\b");
for loop in $list; 
  mkdir "/mnt/${loop}"; 
  mount "/dev/mapper/${loop}" "/mnt/${loop}"; 

View folders:

ls -d /mnt/loop*

Unmount loopbacks:

umount /mnt/loop*
share|improve this answer

You must log in to answer this question.

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