AIX : VG ODM Fix

Method 1.

reducevg -df rootvg 0042d01a6d3bc785

Method 2.

1. find pvid on new hdisk1

#dd if=/dev/hdisk1 count=1 | od -x | grep 0000200 # check this

you should get something like: 0000200 xxxx yyyy zzzz aaa bbbb – that’s your pvid

2. get info about old hdisk1 from ODM

#odmget -q “name=hdisk1” CuDv > /tmp/hdisk1_dv.add

#odmget -q “name=hdisk1” CuAt > /tmp/hdisk1_at.add

3. edit created files by replacing old hdisk1’s pvid to new one

# vi /tmp/hdisk1_dv.add

# vi /tmp/hdisk1_at.add

4. add this new information to ODM

# odmadd /tmp/hdisk1_dv.add

# odmadd /tmp/hdisk1_at.add

5. remove disk from system

# reducevg vgname hdisk1

# rmdev hdisk1

6. Add new disk to system

# extendvg -f vgname hdisk1

Method 3.

PV=hdisk1 # check this

VG=rootvg

cp /etc/objrepos/CuAt /etc/objrepos/CuAt.$$

cp /etc/objrepos/CuDep /etc/objrepos/CuDep.$$

cp /etc/objrepos/CuDv /etc/objrepos/CuDv.$$

cp /etc/objrepos/CuDvDr /etc/objrepos/CuDvDr.$$

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

odmdelete -q “value1=10” -o CuDvDr

odmdelete -q “value3=$VG” -o CuDvDr

importvg -y $VG $PV # ignore lvaryoffvg errors

varyonvg $VG


Addendum : If you find, as you may with provisioing VIOS storage, that *new* PV’s have old VG details, when cfgmgr is run, then exportvg is a good way to remove the VG prior to re-defining it.

About troyski

I'm a freelance UNIX engineer working in the UK. I'm married to Tina and between us we have six children. I'm a bit of an Apple fan boy, and all the Windows machines in the house are a thing of the past now.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Post navigation