How to mount a iso file

So you’ve a cd image in iso format and you want to accesss it. Quite simple, it consists of two parts, creating a loopback device and then mounting this block device to any mount point.

1. Creating a loopdevice using lofiadm

# lofiadm -a /export/home/cdimage.iso /dev/lofi/1

If this file already exists then simply go for /dev/lofi/2 and so on.

2. Mounting the block device to a mount point

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

Here hsfs is the filesystem type for CD-ROM/DVD on Solaris platform.

Fortunately there is a quicker alternative to firing both the commands. The output of these can be achieved in a single command

# mount -F hsfs -o ro `lofiadm -a /export/home/cdimage.iso` /mnt/cdrom

Ans so now you can access the iso like a mount cdrom at the mount point.

To unmont use ‘umount’ command and the mount point.

# umount /mnt/cdrom

And so you’re done.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: