Run the script in this document when the ODM (Object Data Manager) entries for the root volume group are corrupted. For non-rootvg volume groups, all that should be required is to varyoff the volume group, export the volume group, and re-import it. If the volume group cannot be varied off for some reason, the script may be modified for volume groups other than rootvg. (See the section "About the script" in this document.) This document applies to all levels of AIX Version 4.x.
IBM documentation can also be found online at the following
URL:
http://www.rs6000.ibm.com/resource/aix_resource/Pubs/index.html
When the ODM entries for a volume group are corrupted, you may notice one of the following symptoms:
lsvg -l [VGname]
Before using the following script, you may wish to save the current version of your /etc/objrepos/Cu* files, in case you want to go back to that version at some time. This is optional. Enter:
mkdir /etc/objrepos/Cu.bak
cp /etc/objrepos/Cu* /etc/objrepos/Cu.bak
To run this script for a volume group other than the rootvg, you must change the VG variable to match the volume group you wish to fix, and change the PV variable to match any one of the physical volumes (/dev/hdisk#) that is a member of that volume group. To determine to which VG a PV belongs, enter the command:
lsvg `lqueryvg -vp [hdisk#] ` | grep GROUP
Please note that grave (back tic) characters are used in the preceding command.
| [ | left bracket |
| ] | right bracket |
PV=/dev/ipldevice
VG=rootvg
lqueryvg -Lp $PV | awk '{ print $2 }' | while read LVname; do
odmdelete -q "name = $LVname" -o CuAt
odmdelete -q "name = $LVname" -o CuDv
odmdelete -q "value3 = $LVname" -o CuDvDr
odmdelete -q "dependency = $LVname" -o CuDep
done
odmdelete -q "name = $VG" -o CuAt
odmdelete -q "parent = $VG" -o CuDv
odmdelete -q "name = $VG" -o CuDv
odmdelete -q "name = $VG" -o CuDep
odmdelete -q "dependency = $VG" -o CuDep
if [ "$VG" = rootvg ]
then
odmdelete -q "value1 = 10" -o CuDvDr
else
odmdelete -q "value1 = $VG" -o CuDvDr
fi
odmdelete -q "value3 = $VG" -o CuDvDr
importvg -y $VG $PV # ignore lvaryoffvg errors
varyonvg $VG
synclvodm -v $VG
savebase
[ Doc Ref: 90605223414650 Publish Date: Feb. 06, 2001 4FAX Ref: 2418 ]