01/24/95 Rebuilding the ODM in AIX 3.2 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. +----------------------------------------------------------+ | | | NOTE: The information in this document has NOT been | | verified for AIX 4.1. | | | +----------------------------------------------------------+ ABOUT THIS DOCUMENT You may choose to rebuild the entire ODM database (see "Steps to Rebuild the Entire ODM Database" on page 4), or you may try to establish what exactly is in the ODM and selectively alter the ODM, with the following steps. SELECTIVELY ALTERING THE ODM You can selectively alter the ODM with the following steps. If you wish to rebuild the entire ODM database, go to the "Steps to Rebuild the Entire ODM Database" on page 4. 1. Before running any "odmdelete" or "odmadd" commands, it is recommended that you save the original copies of the Cu* files, like this: cd /etc/objrepos cp CuAt cuat.old cp CuDep cudep.old cp CuDv cudv.old cp CuDvDr cudvdr.old cp CuVPD cuvpd.old 2. In general, to find out what is in the ODM, you can run the odmget command. There are five files on which you would want to run odmget. These files are in /etc/objrepos; their names are CuAt, CuDep, CuDv, CuDvDr, and CuVPD. The syntax for odmget would be: odmget CuAt > /tmp/cuat odmget CuDep > /tmp/cudep odmget CuDv > /tmp/cudv odmget CuDvDr > /tmp/cudvdr odmget CuVPD > /tmp/cuvpd Rebuilding the ODM in AIX 3.2 1 01/24/95 Then you can use pg, vi, or another editor on the /tmp/cu* files to "see" what is in the ODM. You can also "grep" for items, if you know what you are looking for, like this: (This assumes that you put the output of the odmget commands in the /tmp directory, in files beginning with the letters "cu".) grep 'vg_name' /tmp/cu* where "vg_name" is the word for which you are looking. For example: grep vg00 /tmp/cu* Be aware that there might be entries associated with vg00 which do not have the word "vg00" in them (those entries may have the vgserial_id in them), so it might be necessary to page through the /tmp/cu* files to find other entries that need to be deleted. It would be a good idea to write down the vgserial_id of vg00 before deleting it from the ODM. Although, if you do not over- write the /tmp/cu* files with new odmget commands, you will still have that information to reference, if needed. 3. To clear all error messages that you are getting about vg00, you might try deleting the entries you found in the last step that are related to vg00. You can delete them with the odmdelete format shown below. BE CAREFUL! If you run "odmdelete -o CuAt", for example, you will delete EVERYTHING in /etc/objrepos/CuAt! Consider backing up each /etc/objrepos/Cu* file if you have not already done so. +----------------------------------------------------------+ | | | VG=vg00 | | 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 | | odmdelete -q "value1 = $VG" -o CuDvDr | | odmdelete -q "value3 = $VG" -o CuDvDr | | | +----------------------------------------------------------+ If you need to specify two criteria, use AND to join them, like this: odmdelete -q "value3 = $VG AND name = xxxx" -o CuDvDr 4. To delete all logical volumes associated with vg00, you might try the following: a. Run "getlvodm -v vg00". The output should be a 16-digit number, for example "00005264c192a1a3". b. Run "grep 00005264c192a1a3 /tmp/cuat". The output should be of the form: Rebuilding the ODM in AIX 3.2 2 01/24/95 value = "00005264c192a1a3" value = "00005264c192a1a3.1" value = "00005264c192a1a3.2" value = "00005264c192a1a3.3" value = "00005264c192a1a3.4" value = "00005264c192a1a3.5" Note the numbers following the dots. In the above example, that would be "1 through 5". c. Run "vi /tmp/cuat" and search for "00005264c192a1a3". Skip the first one (which does not have a "dot" in it). Note the "name=" for each of the following: value = "00005264c192a1a3.1" value = "00005264c192a1a3.2" value = "00005264c192a1a3.3" value = "00005264c192a1a3.4" value = "00005264c192a1a3.5" Here is an example of one of the stanzas: CuAt: name = "hd61" attribute = "lvserial_id" value = "00005264c192a1a3.1" type = "R" generic = "D" rep = "n" nls_index = 648 In this case, you would note that value = "00005264c192a1a3.1" is associated with name = "hd61" d. Run the following three commands for every logical volume associated with vg00. For example: odmdelete -q "name = hd61" -o CuAt odmdelete -q "name = hd61" -o CuDv odmdelete -q "value3 = hd61" -o CuDvDr Replace "hd61" which each of the other logical volume names associated with vg00. e. Check the file /etc/swapspaces for an entry for any of the logical volumes that you ran odmdelete on. If you find any, remove those stanzas. For example, hd61 was in /etc/swapspaces, as follows: hd61: dev = /dev/hd61 You should delete those two lines. 5. Determine which disk is the boot disk with the lslv command. The boot disk will be shown in the PV1 column of the lslv output. Rebuilding the ODM in AIX 3.2 3 01/24/95 lslv -m hd5 6. Use the following command to save the changes that you have made: (Use the # of the hdisk which contains hd5, found in step 5.) savebase -d /dev/hdisk# 7. If you successfully altered the ODM database, YOU DON'T NEED TO CONTINUE WITH THE STEPS IN THE FOLLOWING SECTION. STEPS TO REBUILD THE ENTIRE ODM DATABASE If you were not able to selectively alter the ODM database with the steps in the previous section, you may wish to use the following steps to rebuild the entire ODM database. +----------------------------------------------------------+ | | | WARNING: When you rebuild the ODM customized devices | | database, you will lose any special configuration you | | have for customized devices. For example: | | | | o Custom configuration for x.25, ttys, printers, etc. | | will be lost. You should save this information | | before rebuilding the ODM. | | | | o Any user-created volume groups will have to be re- | | added with | | | | importvg -y vgname hdiskx | | | | where vgname is the volume group name and x is the | | number of any of the hard disks containing the | | volume group to be added. | | | | o Your system name will be lost and possibly other | | configuration parameters for TCP/IP. You should | | save TCP/IP configuration before rebuilding the ODM. | | | +----------------------------------------------------------+ 1. Turn the key to the Service position. 2. With bootable media OF THE SAME VERSION AND LEVEL AS THE SYSTEM, boot the system. Rebuilding the ODM in AIX 3.2 4 01/24/95 +----------------------------------------------------------+ | | | WARNING: If you boot a 3.2 system with 3.1 media, or | | boot a 3.1 system with 3.2 media, then you will not be | | able to use the standard scripts (getrootfs or | | /etc/continue) to bring your workstation into full main- | | tenance mode. | | | | Moreover, performing the scripts on a 3.1 system with | | 3.2 boot media may actually remove some files and | | prevent your system from booting successfully in normal | | mode until missing files (/etc/mount and /etc/umount) | | are replaced on the disk. | | | +----------------------------------------------------------+ NOTES: a. For information on BOSboot diskettes, refer to InfoExplorer or order fax #2462 from 1-800-IBM-4FAX (or 415-855-4FAX outside the U.S. from a fax machine phone). b. If booting from diskettes, when you see LED c07, insert the next diskette. This may be the optional display extensions diskette (required for AIX 3.2.5) or the display diskette. c. If you have AIX 3.2.5, used a fddi network install, and selected that option for the install device, you will need the communications extensions diskette. If this diskette is not available, you can build it from another system with fddi installed or call your branch office for assistance. Follow the prompts to the installation/maintenance menu. 3. Choose the maintenance shell (option 4 for AIX 3.2). 4. Determine the hdisk# to use with the getrootfs command. If you have only one disk, then "hdisk0" is the proper hdisk# to use. If you have more than one disk, do the following: o FOR AIX 3.2.4 OR LATER: Run getrootfs The output indicates the disk that should be used with getrootfs in the next step. o FOR AIX 3.2 TO 3.2.3E: Run lqueryvg -Atp hdisk# | grep hd5 Rebuilding the ODM in AIX 3.2 5 01/24/95 for each hdisk# (hdisk0, hdisk1, etc.) until you get output that looks like: 00005264feb3631c.2 hd5 1 The exact output you get will be different but will follow the form large_number.x hd5 1 You may find more than one disk has this output. These will all be disks which belong to the rootvg volume group. You may use any of the disks identi- fied to be in rootvg in the following step. 5. Now access the rootvg volume group by running getrootfs ("#" is the number of the fixed disk, determined in step 4). NOTE: This imports the rootvg volume group and starts a shell so that you can perform maintenance before the file systems are mounted. getrootfs hdisk# sh If you get errors from /etc/continue or getrootfs, do not continue with the rest of this procedure. Correct the problem causing the error. If you need assistance correcting the problem causing the error, contact one of the following: o local branch office o your point of sale o 1-800-CALL-AIX (to register for fee-based services) All of the above avenues for assistance may be billable. 6. For AIX 3.2.4 or greater, enter the following command: ODMDIR=/dev/objrepos 7. Run the following to mount the /dev/hd4 and /usr file systems. (Here, we are mounting /dev/hd4 in a temporary location for maintenance purposes instead of on the "/" mount point.) mount /dev/hd4 /mnt mount /usr 8. This step is optional. With the following commands, copy the system configuration to a backup directory: mkdir /mnt/etc/objrepos/backup cp /mnt/etc/objrepos/Cu* /mnt/etc/objrepos/backup 9. Now copy the configuration from RAM. cp /etc/objrepos/Cu* /mnt/etc/objrepos 10. With the following command, unmount the file systems. (Be sure to include the path for the umount command.) Rebuilding the ODM in AIX 3.2 6 01/24/95 cd / /etc/umount all NOTE: The only error you should get in this step is a complaint about the system not being able to unmount /dev/ram0. 11. Type "exit" to exit from the shell. The file systems will automatically mount after you type "exit". 12. Determine which disk is the boot disk with the lslv command. The boot disk will be shown in the PV1 column of the lslv output. lslv -m hd5 13. Use the following command to save the changes that you have made: (Use the # of the hdisk which contains hd5, found in step 12.) savebase -d /dev/hdisk# 14. Turn the key to the Normal position. 15. Now enter the following to shutdown and reboot the system: shutdown -Fr Rebuilding the ODM in AIX 3.2 7 01/24/95 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 (rebuild.odm.32.krn, 4FAX# 2649) Rebuilding the ODM in AIX 3.2 8