Linux – Mount hybrid ISO (ISO 9660/HFS+) under Linux

applehfs+linuxmount

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!

Best Answer

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.

Related Topic