Tanti Technology

My photo
Bangalore, karnataka, India
Multi-platform UNIX systems consultant and administrator in mutualized and virtualized environments I have 4.5+ years experience in AIX system Administration field. This site will be helpful for system administrator in their day to day activities.Your comments on posts are welcome.This blog is all about IBM AIX Unix flavour. This blog will be used by System admins who will be using AIX in their work life. It can also be used for those newbies who want to get certifications in AIX Administration. This blog will be updated frequently to help the system admins and other new learners. DISCLAIMER: Please note that blog owner takes no responsibility of any kind for any type of data loss or damage by trying any of the command/method mentioned in this blog. You may use the commands/method/scripts on your own responsibility. If you find something useful, a comment would be appreciated to let other viewers also know that the solution/method work(ed) for you.

Tuesday 10 December 2013

Loopback Device Support in AIX



Technote (FAQ)

Question
This technote discusses the use of the loopback device to mount file or disk images in AIX

Answer

Introduction
In AIX 6100-04-00-0943 (6.1 TL4) support for a loopback device was added to AIX and VIOS (PowerVM). This device can be used as a block device to provide access to file images.

The file image can be an ISO image, a disk image, a filesystem or a logical volume. These images can be mounted into the filesystem tree via the /usr/sbin/loopmount command.

A loopback device can be created before mounting a file image using /usr/sbin/mkdev or the loopmount command can automatically create it.

According to the AIX 6.1 manuals on Infocenter, there are some restrictions to the loopback device:

* The varyonvg command on a disk image is not supported.
* A CD ISO, and DVD UDF+ISO, and other CD/DVD images are only supported in read-only format.
* An image file can be associated with only one loopback device.
* Loopback devices are not supported in workload partitions.

Mounting a File
To mount a file on the loopback device, the loopmount command is used. In the example below the loopback device is created automatically by the command.

Remember unlike crfs the mount point directory must already exist.

# mkdir /cdmount
# loopmount -i /backup/cd_image_327874 -l loop0 -o "-V cdrfs -o ro" -m /cdmount

# df
/dev/loop0       1678304         0  100%   419576   100% /cdmount

# lsdev -C | grep loop
loop0      Available       Loopback Device

# cd /dev
# ls -l loop*
brw-rw----    1 root     system       34,  0 Nov 27 06:43 loop0
During its existence the loopback device is listed in the CuAt, CuDv and CuDvDr ODM object classes.


Unmounting a File
To unmount a file mounted on the loopback device, use /usr/sbin/loopumount. If the regular /usr/sbin/umount command is used the dynamically created loopback device will not be unconfigured.

# loopumount -l loop0 -m /cdmount
Notice that since the loop0 device was created dynamically in the previous mount it will be deleted when not needed any more.

# df | grep loop

# lsdev -C | grep loop


Possible Problems and Solutions
---------------
# loopmount -i /images/IBM.iso -l loop0 -o "-V cdrfs -o ro" -m /cdmount
1320-003 loopmount: Specified loopback device is not found in ODM
                        Customized Database

Using the -l option assumes the loopback device already exists in /dev and the ODM classes.

If the device doesn't exist you can create it with mkdev:

# mkdev -c loopback -s node -t loopback
loop0 Available
Then use loopmount with -i and -l options to mount into the filesystem tree.

---------------
# loopmount -i /images/IBM.iso -o "-V cdrfs -o ro" -m /cdmount
1320-007 loopmount: Failed to mount the imagefile

Make sure the mount point directory exists
Check the mount options. Readonly must be supplied.

No comments:

Post a Comment