How to mount ISO in solaris & resolve error (iso is not a multiple of 512)
Many software packages download are in the form of an ISO image. Rather than burning the image to a CD-ROM to access its contents, it is easy to mount the image directly into the Solaris file-system using the lofiadm and mount commands.
Given an ISO image in /export/temp/Compusoft.iso, a loopback file device (/dev/lofi/1) is created with the following command:
Given an ISO image in /export/temp/Compusoft.iso, a loopback file device (/dev/lofi/1) is created with the following command:
#lofiadm -a /export/temp/Compusoft.iso
Output
/dev/lofi/1
The lofi device creates a block device version of a file. This block device can be mounted to /mnt with the following command:
#mount -F hsfs -o ro /dev/lofi/1 /mnt
These commands can be combined into a single command:
#mount -F hsfs -o ro `lofiadm -a /export/temp/Compusoft.iso` /mnt
Sometimes when you convert image from .nrg to .iso & converted image is not a multiple of 512 bytes. lofiadm refuses.
Unmount and detach the images
Use umount command to unmount image:
#umount /mnt
#lofiadm -d /dev/lofi/1
Error:
# lofiadm -a
/export/temp/Compusoft.iso
lofiadm: size of
/export/temp/Compusoft.iso is not a multiple of 512
Solution:
# cd /export/temp
# dd if=./Compusoft.iso of=./Compusoftnew.iso obs=512 conv=sync# lofiadm -a /export/temp/Compusoftnew.iso
/dev/lofi/1
# mount -F hsfs -o ro /dev/lofi/1 /mnt
Comments