How to mount the pc/iso partition of an iso file when it also contains an HFS partition

hdiutilisomountoptical-drive

I have a disc image with the .iso file extension. Mounting this brings up contents that look much like I would expect from something 20 years ago on a pre-OSX Mac. When I do a mount command in Terminal, it shows this file as mounting with the HFS filesystem (confirming my suspicions). But this was not a Mac-only disc, it's an image of a hybrid disc (or so I believe).

Is there a way to mount this so that it looks like what a PC owner or Linux user would see? The manpage for hdiutil suggests absolutely nothing of use for the "attach" command. None of the options work.

And the mount command is problematic in that I cannot figure out what options will make it work (other than that I need -t iso_9660, the other requirements seem quite different from what they'd be on linux).

Best Answer

You can check that the .iso file does indeed have an HFS/HFS+ volume on it with the file command (I can't remember if this is native or if I installed it via homebrew... might have to do that yourself):

file -k --mime path/to/something.iso

If it does have an HFS volume, then the output will be 3 lines (instead of 2).

something.iso: application/x-iso9660-image
- application/x-apple-diskimage
- application/octet-stream; charset=binary

To mount the PC portion, you have to do more than just doubleclick.

hdiutil attach -nomount something.iso 

This will produce output something like this:

/dev/disk3              Apple_partition_scheme          
/dev/disk3s1            Apple_partition_map             
/dev/disk3s2            Apple_HFS

Keep in mind that depending on what else you might have mounted, the disk number can change. If so, amend the following command:

mount -t cd9660 /dev/disk3 ./path/where/contents/will/show

Also, you will need an empty directory, the path/where/contents/will/show. You can create it as you would any other way on OSX. It can be a relative path, or an absolute one. It won't automatically remove itself after you're done mounting this though.

Finally, when you are ready to get rid of this, there are several commands to undo all of this.

umount ./path/where/contents/will/show
hdiutil detach /dev/disk3

Doing this more than once or twice has the tendency to cause my iMac running Mojave to lock up and required a reboot (but I had done this with as many as half a dozen ISOs at that point).

I forget where I found this (didn't figure it out on my own), and I think it was on Stackoverflow. I apologize to whomever posted the answer there as I can no longer give credit. Answering it here though will make it easier for others to find.