Mounting an ISO file on Solaris

Nowadays most of the software package bundles, patches, EIS media's and OS media's are being released in an ISO format.

Burning the ISO image into an empty CD/DVD, and then inserting or mounting it on Solaris to access the data is a time killing activity.

To save your time and CD/DVD, here is the simple procedure for mounting the ISO image directly on Solaris to access the data easily.

Step: 1

Make sure the Solaris host machine is able to access the ISO file locally or through NFS.

Step: 2

Create a block device of the ISO image using lofiadm command,

 # lofiadm -a <ISO file name along with path>

  Example:

      # lofiadm -a /iso_image.iso
      /dev/lofi/1

Step: 3

Mount the block device using mount command,

  # mount -F hsfs -o ro <lofi device file>  <mount point>

  Example:

       # mount -F hsfs -o ro /dev/lofi/1 /mnt


Now you have successfully mounted the ISO file directly.  The content of the ISO file can be accessed through /mnt.

Other useful commands:

  • To check the mounted block device
        # df -hF hsfs

        Filesystem   size    used   avail  capacity  Mounted on
        /dev/lofi/1   6.3M  6.3M    OK       100%    /mnt

  • To list the content of the /mnt
        # ls /mnt
        sun cluster 3.2  sun servers  veritas

  • To view the list of block device created using lofiadm command,
       # lofiadm

       Block device     File
       /dev/lofi/1          /iso_image.iso
       /dev/lofi/2          /tmp/Veritas.iso

  • To delete the unused block device created using lofiadm,
        # lofiadm -d /dev/lofi/2

Note:

The block device/ISO image can be auto mounted persistently by adding the same into /etc/vfstab file.






Post a Comment

0 Comments