页面

Wednesday, February 2, 2011

Mount a ISO image on AIX 5.3

The following instructions were cribbed from the Howto mount an ISO image in AIX UNIX


  1. Create a logical volume which is large enough to hold the ISO image: # /usr/sbin/mklv -y testiso -t jfs rootvg 1

    where:
    o
    testiso is the name of the logical volume,
    o
    rootvg is the name of the volume group in which the logical volume is to be created, and
    o
    1 is the size of the logical volume in logical partitions.
    Use the command lsvg rootvg to display (among many other things) the (logical and physical) partition size which will be used in
    rootvg. See here for more information about the AIX V5.3 mklv command.

  1. Define a read-only JFS filesystem on the logical volume: # /usr/sbin/crfs -v jfs -d testiso -m /testiso -An -pro -tn -a frag=4096 -a nbpi=4096 -a ag=8
    Based on the parameters chosen, the new /testiso JFS file system
    is limited to a maximum size of 134217728 (512 byte blocks)
    New File System size is 65536

    where:
    o
    testiso is the name of the logical volume created in the first step and
    o
    /testiso is the mount point of the filesystem.
    See here for more information about the AIX V5.3
    crfs command.

  1. Copy the contents of the ISO image to the logical volume:
    # /usr/bin/dd if=/tmp/bestprac.iso of=/dev/rtestiso bs=1m
    0+1 records in.
    0+1 records out.
     
    where:
    o
    testiso is the name of the logical volume created in the first step, prefixed with the character r and
    o
    /tmp/bestprac.tar is the ISO image file to be examined.
    It may be necessary to use a block size (
    bs=1m) of less than a megabyte if the logical partition size is less than a megabyte. See here for more information about the AIX V5.3 dd command.

  1. Change the filesystem type to cdrfs:
    # chfs -a vfs=cdrfs /testiso

    Note
    It is possible to mount the filesystem by overriding the filesystem type with mount -v cdrfs /testiso, but other problems occur when the time comes to remove the filesystem:
     # rmfs -ir /testiso
    rmfs: Warning, all data contained on /testiso will be destroyed.
    rmfs: Remove filesystem: /testiso? y(es) n(o)? y
    rmfs: 0506-933 /dev/testiso is not recognized as a JFS filesystem.
    rmfs: 0506-936 Cannot read superblock on /testiso.
    rmfs: Unable to clear superblock on /testiso
    rmlv: Logical volume testiso is removed.
     
  2. Mount the filesystem:
    # /usr/sbin/mount /testiso

    The filesystem contains the files which are in the ISO image file /tmp/bestprac.tar:
    # cd /testiso
    /testiso # ls
    bestprac.tar.gz
    /testiso #
  3.  
  1. When the filesystem is no longer needed, unmount and remove it and then remove the testiso logical volume:
    /testiso # cd
    # /usr/sbin/umount /testiso
    # /usr/sbin/rmfs -ir /testiso
    rmfs: Warning, all data contained on /testiso will be destroyed.
    rmfs: Remove filesystem: /testiso? y(es) n(o)? y
    # /usr/sbin/rmlv testiso
    Warning, all data contained on logical volume testiso will be destroyed.
    rmlv: Do you wish to continue? y(es) n(o)? y
    rmlv: Logical volume testiso is removed.

    where:
    o
    testiso is the name of the logical volume created in the first step and
    o
    /testiso is the mount point of the filesystem.
    Be very careful with rmfs. Like the UNIX rm command, rmfs without the -i flag does not prompt for confirmation. It immediately destroys the specified filesystem!
    Notes:
  • The rmfs -r flag will cause the mount point directory to be removed only if the directory is empty.
  • The rmfs command will remove the underlying logical volume when removing a JFS or JFS2 filesystem, but will not do so when removing a CDRFS filesystem.

No comments:

Post a Comment