Friday 8 January 2010

Accessing OSX install DVD from Linux/Ubuntu

Have you ever tried sticking your Mac [Snow] Leopard/Tiger OSX installation DVD/CD disks into a Linux box and just found a measly little windows partition there with the BootCamp stuff on it, and wondered where all the Mac stuff was hiding? Yeah so have I.

This is how to copy the disk using the dd command (you can do virtually the same thing on OSX - here's an article with some more info):
dd if=/dev/sr0 of=/DVDcopy.iso
For older versions of *NIX (which used to use '-if/-of'):
dd -if=/dev/sr0 -of=/DVDcopy.iso 

However whilst Ubuntu doesn't understand - it is all there just hiding... This handy site explained a way to get to it - directly on DVD. You can use your DVDcopy.iso in the same way. You'll probably need to install the tool (e.g. aptitude install kpartx). On your Linux box you do:
#sudo kpartx -av /DVDcopy.iso
add map loop0p1 (252:0): 0 60 linear /dev/loop0 4
add map loop0p2 (252:1): 0 2020420 linear /dev/loop0 64
add map loop0p3 (252:2): 0 13158216 linear /dev/loop0 2020488
add map loop0p4 (252:3): 0 12 linear /dev/loop0 15178704

Then use file to find out which partition contains the Mac stuff - run file on each one till you find one that says it's an Macintosh HFS e.g:
sudo file -s /dev/mapper/loop0p3
/dev/mapper/loop0p3: Macintosh HFS Extended version 4 data last....

The mount it and you're away:
sudo mount /dev/mapper/loop0p3 /my_mount

You should now be able to see the contents of the Mac (HFS+) partition in the directory /my_mount

2 comments:

  1. This was very helpful, thanks a bunch.

    I realize that this is an old post, but as a *nix novice, I was stuck on why the dd command wouldn't work for me. Would you mind changing the syntax to dd if=/dev/sr0 of=/yourDisc.iso (ie. no dashes before if and of).

    Thanks again for the help.

    ReplyDelete