12/03/96, 4FAX# 1755 Recovering Volume Groups in AIX SPECIAL NOTICES Information in this document is correct to the best of our knowledge at the time of this writing. Please send feedback by fax to "AIXServ Information" at (512) 823-4009. Please use this information with care. IBM will not be responsible for damages of any kind resulting from its use. The use of this information is the sole responsibility of the customer and depends on the customer's ability to eval- uate and integrate this information into the customer's operational environment. ABOUT THIS DOCUMENT Run the script in this document when the ODM (Object Data Manager) entries for the root volume group are corrupted. The script may be modified for volume groups other than rootvg. (See the 'About the Script' section in this docu- ment.) This document applies to all levels of AIX 3.1 through 4.2. PROBLEM DETERMINATION When the ODM entries for a volume group are corrupted, you may notice one of the following symptoms: o "lsvg", "lslv", and/or "lspv" commands fail. o You cannot change the size of file systems. o The system cannot find volume groups or device IDs. o The output of the following command contains "?"s in some fields or some fields are blank: lsvg -l VGname BEFORE USING THE SCRIPT Before using the following script, save the current version of your /etc/objrepos/Cu* files, in case you want to go back to that version at some time. (In the following commands, replace "mmdd" with the month and day, such as "jan01".) cd /etc/objrepos cp CuAt cuat.mmdd cp CuDep cudep.mmdd cp CuDv cudv.mmdd cp CuDvDr cudvdr.mmdd Recovering Volume Groups in AIX 1 12/03/96, 4FAX# 1755 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 phys- ical volumes that is a member of the rootvg volume group. If you wish 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 (backtic) characters are used in the aforementioned command. 3. It is not necessary to reboot after running this script. 4. If this is being used to clean up a rootvg AND the rootvg is mirrored, the user must run the bosboot command to the disks that make up the bootable rootvg. Note, there is no need to reboot after the bosboot. 5. Note that 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 and/or permissions changed. Running this script may thus require you to shutdown applications that operate in this manner, and change the permissions/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 | | | +----------------------------------------------------------+ Recovering Volume Groups in AIX 2 12/03/96, 4FAX# 1755 3. Please note that 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 mark 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 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 ---------------------------------------------------------------------- Recovering Volume Groups in AIX 3 12/03/96, 4FAX# 1755 READER'S COMMENTS Please fax this form to (512) 823-4009, attention "AIXServ Informa- tion". You may also e-mail comments to: elizabet@austin.ibm.com. These comments should include the same customer information requested below. Use this form to tell us what you think about this document. If you have found errors in it, or if you want to express your opinion about it (such as organization, subject matter, appearance) or make sug- gestions for improvement, this is the form to use. If you need technical assistance, contact your local branch office, point of sale, or 1-800-CALL-AIX (for information about support offer- ings). These services may be billable. Faxes on a variety of sub- jects may be ordered free of charge from 1-800-IBM-4FAX. Outside the U.S. call 415-855-4329 using a fax machine phone. When you send comments to IBM, you grant IBM a nonexclusive right to use or distribute your comments in any way it believes appropriate without incurring any obligation to you. NOTE: If you have a problem report or item number, supplying that number may help us determine why a procedure did or did not work in your specific situation. Problem Report or Item #: Branch Office or Customer #: Be sure to print your name and fax number below if you would like a reply: Name: Fax Number: ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ END OF DOCUMENT (rvgrecover.krn, 4FAX# 1755) Recovering Volume Groups in AIX 4