Tuesday, June 30, 2015

Solved: 'mount failed - no mountable file systems' When Trying To Mount ISOs under OS X

Update

Nevermind what I wrote below; the diagnosis is right, but the solution is wrong. A much simpler approach, which I finally found mentioned here, is to simply install 7Zip. Files from the ISO can then be extracted via: 7z x -o<destination dir> -y <ISO file>


Recorded for posterity because it took me way too long to figure this out and I generally know what I'm doing. Thanks to Rod Smith, who's comment here put me on the right track.

The Problem

You're trying to mount an ISO image under OS X and you're getting the error 'mount failed - no mountable file systems'.

Symptoms:

  • The ISO image is probably a Linux installation CD/DVD. In researching this question it seems to turn up most frequently in connection with recent Ubuntu releases, but it also affects RedHat-derived systems.
  • Linux virtual machines running on the Mac via a hypervisor can mount the ISO no problem.

What's Going On?

Sometime in the not-too-distant past a bunch of Linux distros started putting out installation ISOs that are designed to work both when written to a CD and dd'd to a USB key. This is accomplished via the creation of a partitioned ISO9660 image (usually via genisoimage it seems) that tends to make OS X sad. Looking at a sample image:

$ hdiutil imageinfo OL7.iso
...
 partitions:
  0:
   partition-name: Master Boot Record
   partition-start: 0
   partition-synthesized: true
   partition-length: 1
   partition-hint: MBR
   boot-code: 0x33ED90909090909090909090909090909090909090909090909090909090909033EDFA8ED5BC007CFBFC6631DB6631C96653665106578EDD8EC552BE007CBF0006B90001F3A5EA4B06000052B441BBAA5531C930F6F9CD13721681FB55AA751083E101740B66C706F106B442EB15EB005A51B408CD1383E13F5B510FB6C64050F7E1535250BB007CB9040066A1B007E844000F828000664080C702E2F266813E407CFBC078707509FABCEC7BEA447C0000E8830069736F6C696E75782E62696E206D697373696E67206F7220636F72727570742E0D0A66606631D2660306F87B661316FC7B6652665006536A016A1089E666F736E87BC0E40688E188C592F636EE7B88C608E141B801028A16F27BCD138D64106661C3E81E004F7065726174696E672073797374656D206C6F6164206572726F722E0D0A5EACB40E8A3E6204B307CD103C0A75F1CD18F4EBFD000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005811010000000000023B61660000
  1:
   partition-name: OL-7.1 x86_64
   partition-start: 1
   partition-synthesized: true
   partition-length: 146919
   partition-hint: Apple_ISO
  2:
   partition-start: 146920
   partition-number: 2
   partition-length: 12616
   partition-hint: Type EF
   partition-filesystems:
    FAT12: ANACONDA
  3:
   partition-name: OL-7.1 x86_64
   partition-start: 159536
   partition-synthesized: true
   partition-length: 538512
   partition-hint: Apple_ISO
...

A Solution

After some trial and error I determined that you can extract an ISO that mounts under OS X by snagging the first two partitions, which encompass the MBR and actual CD image. In the case of the example image above these partitions start at offset 0 and continue for (1+146919)=146920 512-byte blocks:

$ hdiutil mount OL7.iso
hdiutil: mount failed - no mountable file systems
$ dd if=OL7.iso of=test.iso count=146920 bs=512
146920+0 records in
146920+0 records out
75223040 bytes transferred in 0.308544 secs (243800104 bytes/sec)
$ hdiutil mount test.iso
/dev/disk2                                         /Volumes/OL-7.1 x86_64
$ ls /Volumes/OL-7.1\ x86_64/
EFI        LiveOS        images        isolinux
$

Blog Information Profile for gg00