Sorry, I Don’t Audition

I’m sniffing around for ideas on how to mount an OSX Disk image (a .dmg file) in Ubuntu, and I stumbled on this thread which has some other good Ubuntu ideas. I was tempted to ask there for advice, but apparently, before I’ll be allowed to comment I have to try out:

Audition to become a commenter. To become a registered commenter on this site, you first need to be approved by our team. We’re looking for comments that are interesting, substantial or highly amusing. So write a comment, polish up your words and choose a username and password below. Your comment will only appear once (or if) you’re approved.

I call bullshit on that, but it could be for the best. I think I can live without Lifehacker and they can live without me. Hmph.

So I’ll post my question here, where I’ve already passed the try-outs:

I want to mount an old OSX Disk Image, but it won’t just mount. I’m not really sure how to begin deciphering the missing piece. Is there a filesystem doodad to install? (speaking of which, what is the technically correct way to refer to a package like smbfs? It isn’t a file system, it is a thing that lets you read a file system. Not a utility either. So what?) OSX is based in FreeBSD so it can’t be impossible to mount .dmg files, but it sure isn’t obvious to me how to make it happen.
[tags]technology, whining, linux, learning[/tags]

Comments

posted by arif on 03.29.07 at 5:31 pm

UTW is swallowing my tags! They were there and then, poof. Dang.

So I learned a new command:
file example.dmg

Will tell you, among otherthings, the file type of a file before you. Woo woo.

example.dmg: Apple Partition data block size: 512, first type: Apple_partition_map, name: Apple, number of blocks: 63, second type: Apple_HFS, name: disk image, number of blocks: 81840,

So now I know that I want, loosly, sudo mount -t hfs -o loop Desktop/example.dmg /mnt/example/ but I’m still missing a few things. This is from dmesg:

[17198932.440000] VFS: Can’t find a HFS filesystem on dev loop0.

posted by Amanda on 03.29.07 at 6:06 pm

I’m thinking that’s a kernel module – did you try loading the hfs or hfsplus kernel modules? you also may need to install hfsplus and hfsutils.

posted by arif on 03.29.07 at 7:27 pm

[0 amanda@brahms ~]$ sudo apt-get install hfsutils
Password:
Reading package lists… Done
Building dependency tree… Done
hfsutils is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
[0 amanda@brahms ~]$ sudo apt-get install hfsplus
Reading package lists… Done
Building dependency tree… Done
hfsplus is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
[0 amanda@brahms ~]$

posted by Amanda on 03.30.07 at 1:54 am

so the modules are in fact loaded right? what do you see if you cat /proc/filesystems?

posted by arif on 03.30.07 at 4:28 am

Interesting …

[0 amanda@brahms ~]$ cat /proc/filesystems
nodev sysfs
nodev rootfs
nodev bdev
nodev proc
nodev cpuset
nodev sockfs
nodev securityfs
nodev pipefs
nodev futexfs
nodev tmpfs
nodev inotifyfs
nodev eventpollfs
nodev devpts
cramfs
nodev ramfs
nodev mqueue
nodev usbfs
ext3

posted by Amanda on 03.30.07 at 12:45 pm

So, a little sudo modprobe hfs did add it to /proc/filesystems but it still won’t mount:

[0 amanda@brahms ~]$ sudo mount -t hfs -o ro,loop=/dev/loop0 ./Desktop/dalliance.dmg /mnt/dalliance/
/dev/loop0: No such file or directory
[32 amanda@brahms ~]$ sudo mount -t hfs -o ro,loop ./Desktop/dalliance.dmg /mnt/dalliance/
mount: wrong fs type, bad option, bad superblock on /dev/loop/0,
missing codepage or other error
In some cases useful info is found in syslog – try
dmesg | tail or so

These errors seem a little more interesting. /dev/loop0 and /dev/loop/0 both exist as far as I can tell.

Just FYI, this is all academic at this point. I found a mac user or two who offered to open the file and send it back in a format that I can read.

posted by Amanda on 03.30.07 at 12:56 pm

good, glad the interest is academic since if I keep going, someone going to think I know something about linux.

posted by arif on 04.02.07 at 3:21 am

Thanks for the hfsplus/hfstools hint. I had exactly the same problem with a DMG file image (http://developer.apple.com/internet/webcontent/xmlhttprequest.dmg).

First, load the kernel module for hfsplus: sudo modprobe hfsplus

Then, try with: sudo mount -t hfsplus -o loop ./Desktop/dalliance.dmg /mnt/dalliance/

There seem to be an undocumented filetype called hfsplus (at least it doesn’t appear in the manual for mount), which is needed in order to mount dmg images from newer Mac OS versions. Correct me if I’m wrong, since I barely know Mac.

posted by Marco P. on 04.09.07 at 10:08 am

Bingo.

Thanks, Marco.

Unfortunately, all this has learned me is that dalliance.dmg is a big bundle of .sit files (okay, there are only two.) Now I have to open those and import the font.

posted by Amanda on 04.09.07 at 1:15 pm

Leave a comment