Tuesday, 19 March 2013

AIX ODM Commands

Basic ODM Commands:

NOTE: VERY IMPORTANT
Use these commands with EXTREME CAUTION!!! You should make backup
copies of the individual ODM Class files (CuAt, CuDv, CuDvDr, CuDep,
and CuVPD), before you attempt to use these commands.

First, take a backup of the ODM files by issuing:

cd /etc/objrepos

for i in CuAt CuDv CuDvDr CuDep
do
odmget $i > /tmp/$i.orig
done

1. How to find disk drive in ODM customized database:
odmget -q name=hdisk# CuAt CuAt = Customized Attribute
odmget -q value=hdisk# CuAt
odmget -q name=hdisk# CuDv CuDv = Customized Device
odmget -q value3=hdisk# CuDvDr CuDvDr = Customized Device Driver
odmget -q name=hdisk# CuDep CuDep = Customized Dependency
odmget -q name=hdisk# CuVPD CuVPD = Customized Vital Product Database

2. How to remove disk drive entries from ODM customized database:
odmdelete -q name=hdisk# -o CuAt
odmdelete -q value=hdisk# -o CuAt
odmdelete -q name=hdisk# -o CuDv
odmdelete -q value3=hdisk# -o CuDvDr
odmdelete -q name=hdisk# -o CuDep
odmdelete -q name=hdisk# -o CuVPD

3. How to find VG (rootvg) in ODM database:
odmget -q name=rootvg CuAt
odmget -q name=rootvg CuDv
odmget -q parent=rootvg CuDv
odmget -q value1=rootvg CuDvDr
odmget -q value3=rootvg CuDvDr
odmget -q name=rootvg CuDep

4. How to find LV in ODM database:
odmget -q name=LV CuAt
odmget -q name=LV CuDv
odmget -q value3=LV CuDvDr
odmget -q dependency=LV CuDep

5. How to find an object in CuDvDR by major, minor number:

Example: if major num=10 & minor=1
odmget -q "value=10 and value=1" CuDvDr

6. How to find value (may be pvid of an old disk left in CuAt):

odmget -q value=00001165d6faf66b0000000000000000 CuAt
(Add 16 zeros after the PVID number. This value
should be 32 characters in lenght.)

7. To search the ODM for a specific Item.

odmget CuAt | grep (Specific Item) -> record the number of items
odmget CuDv | grep (Specific Item) -> record the number of items
odmget CuDvDr | grep (Specific Item) -> record the number of items
odmget CuDep | grep (Specific Item) -> record the number of items
odmget CuVPD | grep (Specific Item) -> record the number of items

Now you can use the odmdelete command above to remove the specific item that
you searched for.

No comments:

Post a Comment