How to see what is inside an ISO file on Mac OSX (10.9.5) using command line magic.
I'm in a hurry, just show me the commands
# Create the block device to access the ISO file: hdiutil attach -imagekey diskiamge-class=CRawDiskImage -nomount myfile.iso # The previous command told me the new device was: hdiutil mount /dev/disk5 # Open a Finder window and look for the new disk which should be present. open .
I've got time, tell me more
What if you want to check if the ISO is ok after creating one? What if you've downloaded an ISO file but don't have a CD drive? How would do you deal with this?
Luckily, command line magic can help you with this. The "hdiutil" utility allows you to work with disk images like ISO files. The basic process is create a block device from the ISO file. Then mount the device which Finder can then use.
To create a block device which we can later "mount" we do:
$ hdiutil attach -imagekey diskiamge-class=CRawDiskImage -nomount 汉字图解学习手册.iso /dev/disk5
This creates a new block device entry for the ISO file and called it "/dev/disk5". Now we use "hdiutil" to mount the new block device as follows:
$ hdiutil mount /dev/disk5
You can open a Finder window or do so from the command line to see files:
$ open /Volumes/汉字图解学习手册
Success!
Bonus
You can eject the mounted volume using "hdiutil" as follows:
$ hdiutil eject /dev/disk5 "disk5" unmounted. "disk5" ejected.
Handy References
https://serverfault.com/questions/174909/mount-block-file-on-osx/174945#174945?newreg=1acd5702913c4b319b7eacf21dfab685
http://stackoverflow.com/questions/4549310/loopback-mount-in-osx
© Copyright 2014 by Oisin Mulvihill. Content licensed under the Creative Commons attribution-noncommercial-sharealike License.









