Mounting an ISO
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 /dev/lofi/1 bleonard@opensolaris:~$
Running lofiadm with no parameters will list the associated devices:
bleonard@opensolaris:~$ lofiadm Block Device File Options /dev/lofi/1 /export/home/bleonard/Desktop/sol-10-u5-ga-x86-dvd.iso - bleonard@opensolaris:~$
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 bleonard@opensolaris:~$
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
nice trick, very useful when you need to verify what you are about to burn or use
thanks a lot
Arnaud ZIEBA
Posted by Arnaud ZIEBA on July 23, 2008 at 06:09 AM GMT #
See http://blogs.sun.com/chrisg/entry/automounting_iso_images however in the current nevada builds you don't need the lofi step at all. Mount does it for you.
Posted by Chris Gerhard on July 23, 2008 at 08:40 AM GMT #