Note: Try this on a crash’n’burn system before unleashing it’s
fury on a real AIX system (i.e. one that has users that depend on it!). Always
take a mksysb backup before performing this type of activity.

aixlpar1 :
/tmp # ksh -x fixmyrootvg.ksh

+ + lslv -l
hd5

+ grep hdisk

+ head -1

+ awk {print
$1}

PV=hdisk0

+ VG=rootvg

+ lqueryvg
-Lp hdisk0

+ awk {
print $2 }

+ read
LVname

+ odmdelete
-q name = hd5 -o CuAt

0518-307
odmdelete: 5 objects deleted.

+ odmdelete
-q name = hd5 -o CuDv

0518-307
odmdelete: 1 objects deleted.

+ odmdelete
-q value3 = hd5 -o CuDvDr

0518-307
odmdelete: 1 objects deleted.

+ odmdelete
-q dependency = hd5 -o CuDep

0518-307
odmdelete: 1 objects deleted.

+ read
LVname

+ odmdelete
-q name = hd6 -o CuAt

0518-307
odmdelete: 4 objects deleted.

+ odmdelete
-q name = hd6 -o CuDv

0518-307
odmdelete: 1 objects deleted.

+ odmdelete
-q value3 = hd6 -o CuDvDr

0518-307
odmdelete: 1 objects deleted.

+ odmdelete
-q dependency = hd6 -o CuDep

0518-307
odmdelete: 1 objects deleted.

+ read
LVname

+ odmdelete
-q name = hd8 -o CuAt

0518-307
odmdelete: 3 objects deleted.

+ odmdelete
-q name = hd8 -o CuDv

0518-307
odmdelete: 1 objects deleted.

+ odmdelete
-q value3 = hd8 -o CuDvDr

0518-307
odmdelete: 1 objects deleted.

+ odmdelete
-q dependency = hd8 -o CuDep

0518-307
odmdelete: 1 objects deleted.

+ read
LVname

+ odmdelete
-q name = hd4 -o CuAt

0518-307
odmdelete: 5 objects deleted.

+ odmdelete
-q name = hd4 -o CuDv

0518-307
odmdelete: 1 objects deleted.

+ odmdelete
-q value3 = hd4 -o CuDvDr

0518-307
odmdelete: 1 objects deleted.

+ odmdelete
-q dependency = hd4 -o CuDep

0518-307
odmdelete: 1 objects deleted.

+ read
LVname

+ odmdelete
-q name = hd2 -o CuAt

0518-307
odmdelete: 5 objects deleted.

+ odmdelete
-q name = hd2 -o CuDv

0518-307
odmdelete: 1 objects deleted.

+ odmdelete
-q value3 = hd2 -o CuDvDr

0518-307
odmdelete: 1 objects deleted.

+ odmdelete
-q dependency = hd2 -o CuDep

0518-307
odmdelete: 1 objects deleted.

+ read
LVname

+ odmdelete
-q name = hd9var -o CuAt

0518-307
odmdelete: 5 objects deleted.

+ odmdelete
-q name = hd9var -o CuDv

0518-307
odmdelete: 1 objects deleted.

+ odmdelete
-q value3 = hd9var -o CuDvDr

0518-307
odmdelete: 1 objects deleted.

+ odmdelete
-q dependency = hd9var -o CuDep

0518-307
odmdelete: 1 objects deleted.

+ read
LVname

+ odmdelete
-q name = hd3 -o CuAt

0518-307
odmdelete: 5 objects deleted.

+ odmdelete
-q name = hd3 -o CuDv

0518-307
odmdelete: 1 objects deleted.

+ odmdelete
-q value3 = hd3 -o CuDvDr

0518-307
odmdelete: 1 objects deleted.

+ odmdelete
-q dependency = hd3 -o CuDep

0518-307
odmdelete: 1 objects deleted.

+ read
LVname

+ odmdelete
-q name = hd1 -o CuAt

0518-307
odmdelete: 5 objects deleted.

+ odmdelete
-q name = hd1 -o CuDv

0518-307
odmdelete: 1 objects deleted.

+ odmdelete
-q value3 = hd1 -o CuDvDr

0518-307
odmdelete: 1 objects deleted.

+ odmdelete
-q dependency = hd1 -o CuDep

0518-307
odmdelete: 1 objects deleted.

+ read
LVname

+ odmdelete
-q name = hd10opt -o CuAt

0518-307
odmdelete: 5 objects deleted.

+ odmdelete
-q name = hd10opt -o CuDv

0518-307
odmdelete: 1 objects deleted.

+ odmdelete
-q value3 = hd10opt -o CuDvDr

0518-307
odmdelete: 1 objects deleted.

+ odmdelete
-q dependency = hd10opt -o CuDep

0518-307
odmdelete: 1 objects deleted.

+ read
LVname

+ odmdelete
-q name = local -o CuAt

0518-307
odmdelete: 4 objects deleted.

+ odmdelete
-q name = local -o CuDv

0518-307
odmdelete: 1 objects deleted.

+ odmdelete
-q value3 = local -o CuDvDr

0518-307
odmdelete: 1 objects deleted.

+ odmdelete
-q dependency = local -o CuDep

0518-307
odmdelete: 1 objects deleted.

+ read
LVname

+ odmdelete
-q name = hd7 -o CuAt

0518-307
odmdelete: 3 objects deleted.

+ odmdelete
-q name = hd7 -o CuDv

0518-307
odmdelete: 1 objects deleted.

+ odmdelete
-q value3 = hd7 -o CuDvDr

0518-307
odmdelete: 1 objects deleted.

+ odmdelete
-q dependency = hd7 -o CuDep

0518-307
odmdelete: 1 objects deleted.

+ read
LVname

+ odmdelete
-q name = hd11admin -o CuAt

0518-307
odmdelete: 5 objects deleted.

+ odmdelete
-q name = hd11admin -o CuDv

0518-307
odmdelete: 1 objects deleted.

+ odmdelete
-q value3 = hd11admin -o CuDvDr

0518-307
odmdelete: 1 objects deleted.

+ odmdelete
-q dependency = hd11admin -o CuDep

0518-307
odmdelete: 1 objects deleted.

+ read
LVname

+ odmdelete
-q name = rootvg -o CuAt

0518-307
odmdelete: 3 objects deleted.

+ odmdelete
-q parent = rootvg -o CuDv

0518-307
odmdelete: 0 objects deleted.

+ odmdelete
-q name = rootvg -o CuDv

0518-307
odmdelete: 1 objects deleted.

+ odmdelete
-q name = rootvg -o CuDep

0518-307
odmdelete: 0 objects deleted.

+ odmdelete
-q dependency = rootvg -o CuDep

0518-307
odmdelete: 0 objects deleted.

+ [ rootvg =
rootvg ]

+ odmdelete
-q value1 = 10 -o CuDvDr

0518-307
odmdelete: 1 objects deleted.

+ odmdelete
-q value3 = rootvg -o CuDvDr

0518-307
odmdelete: 0 objects deleted.

+ importvg -y rootvg hdisk0

rootvg

0516-012 lvaryoffvg: Logical
volume must be closed.If the logical

volume contains a filesystem, the
umount command will close

the LV device.

0516-942 varyoffvg: Unable to
vary off volume group rootvg.

+ varyonvg rootvg

+ synclvodm -Pv rootvg

synclvodm:
Physical volume data updated.

synclvodm:
Logical volume hd5 updated.

synclvodm:
Logical volume hd6 updated.

synclvodm:
Logical volume hd8 updated.

synclvodm:
Logical volume hd4 updated.

synclvodm:
Logical volume hd2 updated.

synclvodm:
Logical volume hd9var updated.

synclvodm:
Logical volume hd3 updated.

synclvodm:
Logical volume hd1 updated.

synclvodm:
Logical volume hd10opt updated.

synclvodm:
Logical volume hd7 updated.

synclvodm:
Logical volume hd11admin updated.

+ savebase

Hey Presto! The root volume
group is now named rootvg just the
way we like it!