News, tips, partners, and perspectives for the Oracle Solaris operating system

Mounting an ISO

Guest Author

If you need to pull files from an ISO image file, is it unnecessary to first burn the image to a CD or DVD. By using the lofiadm command you can just mount the ISO and browse its contents.

The lofiadm command associates a file with a block device (you must provide an absolute path to the file). The device that becomes associated with the ISO is returned:

bleonard@opensolaris:~$ pfexec lofiadm -a ~/Desktop/sol-10-u5-ga-x86-dvd.iso 

Running lofiadm with no parameters will list the associated devices:

bleonard@opensolaris:~$ lofiadm
Block Device File

/dev/lofi/1 /export/home/bleonard/Desktop/sol-10-u5-ga-x86-dvd.iso


Now the device can be mounted:

bleonard@opensolaris:~$ pfexec mount -F hsfs /dev/lofi/1 /mnt
bleonard@opensolaris:~$ ls /mnt
boot Copyright installer JDS-THIRDPARTYLICENSEREADME License Solaris_10

The lofiadm and mount steps can be combined into one as follows:

pfexec mount -F hsfs `pfexec lofiadm -a ~/Desktop/sol-10-u5-ga-x86-dvd.iso` /mnt

When finished, use the following to unmount and detach the image:

pfexec umount /mnt
pfexec lofiadm -d /dev/lofi/1 

Join the discussion

Comments ( 1 )
  • Arnaud ZIEBA Tuesday, July 22, 2008

    nice trick, very useful when you need to verify what you are about to burn or use

    thanks a lot

    Arnaud ZIEBA

Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.