Thursday, August 21, 2008

MOUNTING ISO IMAGE UNDER SOLARIS/LINUX/AIX

Mounting ISO images on SOLARIS

To mount /local/sparc.iso file under /mnt directory.
Issue the following commands.

# lofiadm -a /local/sparc.iso /dev/lofi/1
# mount -F hsfs -o ro /dev/lofi/1 /mnt
to unmount
# umount /mnt
# lofiadm -d /dev/lofi/1

Mounting ISO images on LINUX
mount -o loop /path/to/file.iso /path/to/mount/point
Mounting ISO images on AIX

There is a known problem with mounting ISO images on the AIX platform. To workaround the problem, complete the following instructions:

  1. Obtain the size of the image.

    For example:

    # ls -al total 731594 drwxr-xr-x   2 root     system          512 Aug 18 11:33 . drwxr-xr-x   6 root     system          512 Aug 18 11:32 .. -rw-r--r--   1 root     system    374575104 Apr 29 02:59                                              fim_console_rios_aix_5.iso 
  2. Identify the nearest multiple of 128 MB that will provide enough space for the image. In the above example, the image is approximately 374 MB, so use 384 MB as an image size.

    Make a logical volume of this size. Ensure that there is enough space on the physical volume. For example, hdisk0.

    # mklv -y cdlv -s n -L /dev/cdlv rootvg 384M hdisk0

    If the command fails, increase the volume size by a multiple of 128.

  3. Use thedd command to create a pseudo-device. Ensure that the partition has enough space for the pseudo-device. In the following example command, the pseudo-device is /dev/cdlv.
    # dd if=/opt/software/iso/fim_console_rios_aix_5.iso of=/dev/cdlv

    Note that this command may take a long time and will create two dd processes.

  4. Mount the device like a CD-ROM in AIX. Ensure that the mount point exists.
    # mount -v cdrfs -o ro /dev/cdlv /mnt/iso
  5. Change directory into /mnt/iso.

OR

=> chfs: Changes attributes of a file system.
=> mount: Mount a file system
=> rmfs : Remove a file system

First Create a filesystem with crfs command:
#/usr/sbin/crfs -v jfs -g rootvg -a size=800 -m/cd1iso -Ano -pro -tno -a frag=4096 -a nbpi=4096 -a ag=8

This command creates the /cd1iso file system on the rootvg volume group.

Now dd the "iso" image into rlv00
# dd if=image.iso of=/dev/rlv00 bs=10M

Use chfs to change the attributes of a file system:
# chfs -a vfs=cdrom cd1iso
# mount /cd1iso
# cd /cd1iso

When done, remove the filesystem/unmount, enter:
# rmfs /cd1iso

This removes the /cd1iso file system, its entry in the /etc/filesystems (created using chfs command) file, and the underlying logical volume.

No comments: