Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

Help?

EDIT:

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

1 Answer 1

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:

image="/path/to/image"
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; 
do 
  mkdir "/mnt/${loop}"; 
  mount "/dev/mapper/${loop}" "/mnt/${loop}"; 
done;

View folders:

ls -d /mnt/loop*

Unmount loopbacks:

umount /mnt/loop*
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.