Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

I am trying to mount a HFS+ partition in hybrid .dmg file to a local folder.

I found a HFS+ superblock in it (as per instructions in here) and tried to associate it with /dev/loop0 and then mount:

losetup -o MY_HFS_SUPERBLOC_OFFSET /dev/loop0 image.dmg
mount -t hfsplus /dev/loop0 /mnt/cdrom/

However when I ran last command from list above, I get this message:

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

dmesg | tail:

[12130.800828] hfs: failed to load catalog file

I am positive that I'm specifying correct MY_HFS_SUPERBLOC_OFFSET, I followed this Technical Note from Apple on structure of HFS+ partitions and found a matching copy of Volume Header in the end of .dmg file.

How would I mount this image?

All suggestions appreciated!

share|improve this question
A related blog post I saw recently:… – CesarB Oct 27 '09 at 16:19

Not convinced this is going to help all that much, but based on the source of the driver for HFS, it looks like it's struggling to find the b-tree detailed in that technical note. Unfortunately I don't have such a file to even experiment with.

372 HFSPLUS_SB(sb).cat_tree = hfs_btree_open(sb, HFSPLUS_CAT_CNID);

373 if (!HFSPLUS_SB(sb).cat_tree) {

374 printk(KERN_ERR "hfs: failed to load catalog file\n");

375 goto cleanup;

376 }

Unfortunately every link I've dug up based on that is talking about using Linux live disks to fsck broken HFS partitions rather than mounting a dmg image.

share|improve this answer

I had a similar issue even after decompressing the DMG to a normal disk image. Turned out the issue was because my DMG was a Hybrid (FAT+HFS) image and wasnt correctly recognised by the HFS driver.

Check out the following link for a way to do it [ ]

share|improve this answer
Sorry, just noticed the link I posted is same as original poster... so only missing step was to decompress the DMG. – Tricky Jan 9 '13 at 14:17

Dumb answer, but what happens if you just try and do:

mount -t hfsplus image.dmg /mnt/cdrom
share|improve this answer

Some googling turns up Acetone ISO as an open source tool that can deal with DMG-formatted ISO images. I don't know if it will grok the HFS+ metadata, but if all you need is file contents, maybe it will do the job?

share|improve this answer

DMG file format by Mac OS/Apple is a compressed file format. It seems you have found accidentally correct signature sequence in a compressed file and gone 1024 bytes backwards to partition start offset accoding to the article you referenced.

You can uncompress the file dmg with p7zip under windows and linux (I haven't tried under linux) or convert it to uncompressed iso with dmg2iso or another utility.

Hope, that helps...

Best Regards...

share|improve this answer

Your Answer


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.