Rebuilding a Volume Group's Customized Device Database


Contents

About this document
    Related documentation
Problem determination
Before using the script
About the script
The script

About this document

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.

Related documentation

For more in-depth coverage of this subject, the following IBM publications are recommended:

IBM documentation can also be found online at the following URL:
http://www.rs6000.ibm.com/resource/aix_resource/Pubs/index.html


Problem determination

When the ODM entries for a volume group are corrupted, you may notice one of the following symptoms:


Before using the script

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

About the script

  1. This script contains only a few provisions for handling error conditions because it is designed to minimize typing mistakes.

  2. The PV (physical volume) and VG (volume group) variables on the first two lines of the script are defaulted for the root volume group (rootvg). The PV is set to /dev/ipldevice, which is a synonym for one of the physical volumes that is a member of the rootvg volume group.

    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.

  3. It is not necessary to reboot after running this script.

  4. If this script is being used to clean up a rootvg AND the rootvg is mirrored, you must run the bosboot command to the disks that make up the bootable rootvg. There is no need to reboot after the bosboot.

  5. This script calls the synclvodm command, which will change the permissions on all logical volume device files to 660 and their ownership to root:system. This may cause problems with database applications that use raw logical volumes whose device files have had their ownership or permissions changed. Running this script may thus require you to shut down applications that operate in this manner, and change the permissions and ownership on those files when finished.

The script

NOTES:
  1. Run the following script while in Normal mode and logged in as root.

  2. Depending on how you are viewing this document, some characters in the following code may appear incorrectly. If the characters in the following list do not match their descriptions, be sure to change them in the code.

    [ left bracket
    ] right bracket

  3. Page headers and footers may appear in the following code. They should be removed before the code is used. Also, revision bars (vertical bars in the left margin which denote changes in the document) may appear to the left of the code and should be removed before the code is used.
   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 ]