Why Bother Mounting an ISO Image?
Sometimes you find yourself in a situation where you need to take an ISO image and utilize it like a CD or DVD. The popularity of virtual machines and the ability to manipulate larger files over high speed Internet increase the chances that you’ll have to work with an ISO image from time to time. Being able to mount an ISO image as though it were an inserted CD/DVD can make manipulating these kinds of files a bit easier– especially if your computer doesn’t have a CD/DVD ROM drive installed.
Let’s say you have a third party program you need to install, but the vendor only gives you an ISO file. Let’s say the name of the file is thirdparty.iso and you have downloaded that file to /export/home/myhome. Here’s an easy way to utilize this file under Solaris:
The First Step:
# lofiadm -a /export/home/myhome/thirdparty.iso /dev/lofi/1
This first step is necessary for Solaris; In a sense, this command turns the .iso image into a sort of loop back device. With that first command, Solaris is now ready to mount your .iso file.
The Final Step
# mount -F hsfs -o ro /dev/lofi/1 /mnt
Basically, you’re taking the device you just created and you’re mounting it to /mnt as a read-only file. Now, you can descend into /mnt and browse the contents of the ISO image or run any binary files from it as though the image was a CD/DVD spinning in your disk drive.
Sometimes with Linux, procedures can be done in fewer steps than with Solaris. Here’s one of those moments. Let’s mount our thirdparty.iso found in /home/myhome– the Linux way:
# mount -o loop /home/myhome/thirdparty.iso /mnt