Mounting an ISO image in Solaris

The other day I needed to mount an ISO image in Solaris. It turns out there is a simple way to do that using lofiadm command. Using lofiadm you can link a file with a block device that can be mounted later as a regular filesystem. First the file has to be linked to a block device:

bash-3.00# lofiadm -a /path/to/my/ISO /dev/lofi/1

Now the block device can be mounted as usual:

bash-3.00# mount -F hsfs /dev/lofi/1 /mnt

When done, simply unmount the block device and remove the file-device association using lofiadm

bash-3.00# lofiadm -d /dev/lofi/1

More info can be found in lofiadm man page.