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.

I had an HFS+ formatted drive that was going bad and wouldn't mount at all on OSX. I created an image using ddrescue on linux, and was able to save most of it.

I can mount the drive and see the data just fine in linux using this:

mount -o loop -t hfsplus dd_image mountpoint

This doesn't work on my OSX system since hfsplus isn't a valid filesystem type. If I try:

mount -t hfs image mountpoint

It complains that it needs a block device. What's the fix here?

share|improve this question
    
There isn't one. Disappointed me many times. –  squircle Jun 7 '10 at 23:06
    
You've gotta be kidding me... no way to mount a DD image on OSX at all? It's friggin' BSD... –  Paul McMillan Jun 7 '10 at 23:22
    
OSX file systems are HFS+ which is unique to Apple (They had to support old MacOS and so changed from the BSD system they had in NeXT). Note that this is all Unix complient –  Mark Jun 8 '10 at 10:31

5 Answers 5

up vote 8 down vote accepted

Hmm. According to one source, you need hdiutil (OSX hdiutil manpage), as in

hdiutil attach -readonly cdimage.iso

What you're trying to do is known as "loopback mounting", that is, mounting via the loop device. According to Wikipedia's article:

Mac OS X implements a native image mounting mechanism as part of its random access disk device abstraction. The devices appear in /dev as regular disk devices; reads from and writes to those devices are sent to a user-mode helper process, which reads the data from the file or writes it to the file. In the user interface it is automatically activated by opening the disk image. It can handle disk, CD-ROM or DVD images in various formats.

This suggests to me that your OSX system needs to recognize your image as a valid HFS image. Depending on how you created it (did you dd a partition or a whole drive?) you may be able to double-click on the image file, or you may need to give the file the right file extension (.iso or .img, perhaps). On Linux you could use the losetup command to associate the image file with a device like /dev/loop0 (mount -o loop does this for you, but OS X's mount manpage doesn't indicate any similar option).

share|improve this answer
    
I dd'd the whole drive. It's not a valid HFS+ image, as it includes a whole bunch of HFS+ partition tables, not just an image of the partition in question. Changing the file extension definitely doesn't do any good. It's also not formatted as an ISO image (headers and so on), nor is it a native mac img format (same problem). The disk utility will not mount the image at all. –  Paul McMillan Jun 8 '10 at 0:07
1  
@paul: did you try the hdiutil command, or read the manpage? iso and img images don't have headers and so on; they're straight-up dd copies of partitions (so no partition tables as you'd get with dd'ing a whole drive). ISOs are called ISOs because they're often images of ISO-9660 filesystems used in data CDs. you should be able to use hdiutil. try running hdiutil imageinfo image-file-name to see if hdiutil recognizes your image as-is... hdiutil pmap image-file-name may also be useful to see if it recognizes a partition table in your image. –  quack quixote Jun 8 '10 at 1:43
5  
@paul: the manpage gives this example for "forcing a known image to attach": hdiutil attach -imagekey diskimage-class=CRawDiskImage image-file-name –  quack quixote Jun 8 '10 at 1:46

I confirm quack quixote's latest comment: the diskimage-class=CRawDiskImage setting allows an image created by dd to be mounted:

hdiutil attach -imagekey diskimage-class=CRawDiskImage image-file-name

P.S. I copied it here to give it more visibility.

share|improve this answer

I know it is an old thread but this answer would of helped me an hour ago.

Both .DD and .DMG files are RAW image files. You can simply rename the image.dd file to image.dmg. If you have a series of files make sure you name them correctly. ie image.dmg, image.o1dmgpart etc.

share|improve this answer

If you want to ensure the image isn't modified (i.e. if mounting for a forensic examination) be sure the use the -readonly option in your "hdiutil attach".

share|improve this answer

Try using the .dmg file extension, as in dd if=/dev/disk1 of=MacintoshHD.dmg or similar.

This lets you double-click and mount the image in the Finder.

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.