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 
Comments:

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 22, 2008 at 11:09 PM 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 01:40 AM GMT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

The Observatory is a blog for users of Oracle Solaris. Tune in here for tips, tricks and more as we explore the Solaris operating system from Oracle.

Connect with Oracle Solaris:


Search

Archives
« July 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  
       
Today