Can use mount -o on AIX like Linux ?
If you are Linux Guy, you know that the mount command with option loop is the fast way to mount the ISO Image. This is example mount on Linux but its can’t be used on AIX :
mount -o ro,loop dvd.iso /mnt/dvd_iso
Prior to AIX 6.1, I ever used dd command for the AIX 4.3 to 5.3 to access the files in ISO image file.
By used dd the ISO image file to copy the contains to a raw Logical Volume (rLV), then mount the LV as a filesystem.
Next heading are the steps for copying the ISO named dvd.iso into the directory/mnt/iso (generic JFS filesystem):
Mount ISO Image Prior to AIX 6.1 ( AIX 4.3 and upward )
Find out the size of the ISO image
by ls -l or ls -lh command depend on AIX version.
As usual the DVD ISO image approximately 4.7 GB
I have test only AIXV4.3, 5.1,5.3 but I think the old version (if not so far) also have ls ‘s option same as V4.3 too.Shell12345678# AIX 4.3 and upward# Output in Bytes. Consequently, Results in KB, MB, GB by used output bytes and then# divided by 1024, 1024^2, 1024^3, respectively.#ls -l dvd.iso#
Create read-only filesystems
with size bigger then the size from step 1. , don’t mount the filesystem yet !.
Then get the logical volume name associated with the new filesystem :Shell12345678#crfs -v jfs -m/mnt/dvd_iso -Ano -pro -tno -g rootvg -a size=5G#lsfs |grep '/mnt/dvd_iso'# /dev/lv08 -- /mnt/dvd_iso jfs#
The above output , LV name is format like ‘ lvxx’ ; where xx is the running no. 00,01,…
Naming the logical volume manually
for understanding in the future used, so create logical volume and then create filesystem later.
- lsvg to determine the PP sizeShell123lsvg rootvg
PP Size : 64 MB
VOLUME GROUP: rootvg VG IDENTIFIER: 00c9c87a00004c0000000138a145fcde
VG STATE: active PP SIZE: 64 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 799 (51136 megabytes)
MAX LVs: 256 FREE PPs: 144 (9216 megabytes)
LVs: 17 USED PPs: 655 (41920 megabytes)
OPEN LVs: 15 QUORUM: 2
TOTAL PVs: 1 VG DESCRIPTORS: 2
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 1 AUTO ON: yes
MAX PPs per VG: 32512
MAX PPs per PV: 1016 MAX PVs: 32
LTG size (Dynamic): 256 kilobyte(s) AUTO SYNC: no
HOT SPARE: no BB POLICY: relocatable
#LPS = <LV_SIZE> / <PP_SIZE>, From above : #LPS = ( 5120MB / 64MB ) = 80
- lsvg -l rootvg or lslv <<LV_NAME>> to check new logical volume exists or not ?Shell123# lsvg -l rootvg
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
hd5 boot 1 1 1 closed/syncd N/A
hd6 paging 32 32 1 open/syncd N/A
hd8 jfslog 1 1 1 open/syncd N/A
hd4 jfs 11 11 1 open/syncd /
hd2 jfs 25 25 1 open/syncd /usr
hd9var jfs 26 26 1 open/syncd /var
hd3 jfs 25 25 1 open/syncd /tmp
hd1 jfs 21 21 1 open/syncd /home
hd10opt jfs 1 1 1 open/syncd /opt
lg_dumplv sysdump 16 16 1 open/syncd N/A
[/text]Shell1234lslv lv_dvd# 0516-306 lslv: Unable to find lv_dvd in the Device Configuration Database.
- Creates the logical volume
mklv -y <LV_NAME> <VG_NAME> <#LPs>Shell123mklv -y lv_dvd rootvg 80
- Makes the filesystem, creates the mountpoint and puts it in /etc/filesystems
-A no : File system is not mounted at system restart !
crfs -v jfs -d <LV_NAME> -m <MOUNT_POINT> -A noShell123crfs -v jfs -d lv_dvd -m /mnt/dvd_iso -A no
- lsvg to determine the PP size
Use dd command to raw copy
the DVD image into rlv_dvd (raw lv_dvd) :Shell12345dd if=dvd.iso of=/dev/rlv_dvd bs=100M# 43+1 records in.# 43+1 records out.
Note must have r before lv_dvd, This is important !
Mount the file system
:Shell123mount -v cdrfs /mnt/dvd_iso
Note see option -v , Focus on Filesystem type !.
- crfs command above, where we used -v jfs
- mount command use -v cdrfs
Now access to files
in /mnt/dvd_iso like DVD media.
Unmount the filesystem
make sure that your current directory not stay at /mnt/dvd_iso and don’t have any processes access that directory.Shell123unmount /mnt/dvd_iso
Finally, you can remove the filesystem
by following command :Shell1234rmfs /mnt/dvd_iso#rmlv: Logical volume lv_dvd is removed.
Not necessary, if you have more disk spaces i recommend to keep it for next used. You just only umount it in step 7 !.
Mount ISO Image on AIX 6.1 TL4 and upward
loopmount command is now available starting with AIX 6100-04-00-0943 (6.1 TL4), use the oslevel -s to check your current level.
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.
A loopback device can be created before mounting a file image using mkdev or the loopmount command can automatically create it.
According to the AIX 6.1 manuals on Infocenter, these are some restrictions to the loopback device:
- varyonvg command on a disk image is not supported.
- CD ISO, and DVD UDF+ISO, and other CD/DVD images are only supported in read-only mode
- image file can be associated with only one loopback device.
- Loopback devices are not supported in workload partition
Mounting a File
To mount a file on the loopback device, the loopmount command is used.
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:Shell1234mkdev -c loopback -s node -t loopback# loop0 Available
Then use loopmount with -i and -l options to mount into the filesystem tree.
Remember unlike crfs the mount point directory must already exist !.Shell1234567#mkdir /mnt/dvd_iso#loopmount -i dvd.iso -l loop0 -o "-V cdrfs -o ro" -m /mnt/dvd_iso#
During its existence the loopback device is listed in the CuAt, CuDv and CuDvDr ODM object classes.Shell1234567891011df# show the row like this ..# /dev/loop0 4508878 100% 419576 100% /mnt/dvd_iso#lsdev -C | grep loop# loop0 Available Loopback Device#ls -l /dev/loop*# brw-rw---- 1 root system 34, 0 Nov 27 06:43 loop0
Unmounting a File
To unmount a ISO file mounted on the loopback device, use loopumount.
If use the regular umount command, the dynamically created loopback device will not be unconfigured.
loopumount -l loop0 -m /mnt/dvd_iso
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
# <nothing returned>
lsdev -C | grep loop
# <nothing returned>
Recent Howto Mount ISO Image on AIX Search Terms:
- - loop mount iso aix (1)
- - aix mount iso file (1)
- - create a temporary device cd0 aon disk nd mount aix (1)
- - aix loopmount (1)