Mounting CDROM ISO Images in Solaris using lofiadm

Wednesday, November 12, 2008

Many a times we need to mount an ISO Image from CDROM to install a product, in Solaris this process is simplified with the lofiadm command which I used recently to install ISOs and hope this will be a useful reference.

lofiadm is a system administration command in Solaris which allows a file to be associated with a block device which can then be mounted on the local file system.

For example assume that a product is shipped as an ISO Image which needs to be installed, if the ISO file path is /var/tmp/CDImage.iso (say), then the sequence of steps to associate the ISO Image to the block device and mount it to the local file system would be as follows.

1. Remove existing ISO Block device using lofiadm if any

/usr/sbin/lofiadm -d /dev/lofi/1

2. Using lofiadm, associate the CD ISO Image as a block device

/usr/sbin/lofiadm -a /var/tmp/CDImage.iso

3. Mount the CD-ROM block device in the local file system.

/usr/sbin/mount -F hsfs -o ro /dev/lofi/1 /mnt

(Make sure you unmount any existing mounts in /mnt using /usr/sbin/umount /mnt)

Note: In the above mount command the hsfs represents High Seirra file system, a CD-ROM file system for Solaris.

4. cd /mnt to invoke the installer.

(Make sure you cleanup the block device and unmount the /mnt after the installation is complete using /usr/sbin/mount -F hsfs -o ro /dev/lofi/1 /mnt and /usr/sbin/lofiadm -d /dev/lofi/1 respectively).

No comments:

Copyright © 2016 Prasanna Seshadri,, All Rights Reserved.
No part of the content or this site may be reproduced without prior written permission of the author.