Checking the altinst_rootvg oslevel

Edit: Still good to know.

Originally posted April 14, 2020 on AIXchange

What to do when your AIX system has an altinst_rootvg.

Awhile back this interesting question came up: If you’re using alt disk to clone and upgrade your AIX system and later on you log into that system and see it has an altinst_rootvg, how do you determine the AIX version that’s on the inactive disk? What if you want to look at old data or information on that disk?
 
The answer is explained here:
 
Test2:/# oslevel -s
7100-01-04-1141
Test2:/#
 
Test2:/# lspv
hdisk0          00d342e7131c6b47                rootvg        active
hdisk1          00d342d637j21a59                 altinst_rootvg
Test2:/#
 
Test2:/# alt_rootvg_op -W -d hdisk1
Waking up altinst_rootvg volume group …
 
Test2:/#
 
Now the altinst_rootvg is in Active state also alt filesystems are in mounted state on the server
 
Test2:/# lspv
hdisk0         00d342e7131c6b47                 rootvg        active
hdisk1         00d342d637j21a59                  altinst_rootvg  active
Test2:/#
 
Test2:/# df
Filesystem    512-blocks      Free %Used  Iused %Iused Mounted on
/dev/hd4           524288      380024 28%    3091     3% /
/dev/hd2         3801088      396856 90%    34020    8% /usr
/dev/hd9var    2621440     2279336 14%    3560     2% /var
/dev/hd3          524288      499272    5%     105      1% /tmp
/dev/hd1          524288      507336    4%     102      1% /home
/proc                –              –    –          –       –  /proc
/dev/hd10opt    524288        278872    47%       3370     6% /opt
/dev/alt_hd4     524288        365552    31%       3871     3% /alt_inst
/dev/alt_hd1     524288        507336    4%         104      1% /alt_inst/home
/dev/alt_hd10opt 1310720   562888   58%        5694    4% /alt_inst/opt
/dev/alt_hd3     524288        499120    5%         116      1% /alt_inst/tmp
/dev/alt_hd2     5636096      184120   97%     103336   15% /alt_inst/usr
/dev/alt_hd9var 2621440    1835656  30%       6632      3% /alt_inst/var
 
We need to start the chroot shell within the alternate rootvg to identify the OS level/TL/SP information.
 
Test2:/# chroot /alt_inst /usr/bin/ksh
Test2:/# oslevel -s
7100-01-01-1216
Test2:/#
Test2:/# exit
 
You can return to the rootvg environment by exit from the alt shell.
 
Now it is really really important to put the cloned rootvg back to sleep.
 
Test2:/# alt_rootvg_op -S altinst_rootvg
Putting volume group altinst_rootvg to sleep …
forced unmount of /alt_inst/var
forced unmount of /alt_inst/usr
forced unmount of /alt_inst/tmp
forced unmount of /alt_inst/opt
forced unmount of /alt_inst/home
forced unmount of /alt_inst
Fixing LV control blocks…
Fixing file system superblocks…
 
Related: The IBM Knowledge Center explains how to access data between the original rootvg and the new alternate disk and provides this intro to the alt_rootvg_op command. And in an AIXchange post from August 2019, I shared Chris Gibson’s tips on managing multiple instances of alt_rootvg.