Renaming Volume Groups

I’m anticipating a project coming up at work that will hopefully allow me to rearrange some file systems on my TSM server and improve some performance. However, one of the things I want to do as part of this project is to rename some volume groups on the housing AIX server so they make a little more sense in the overall scheme of things. Problem is I was not positive as to how thisĀ  should be done, so I needed to do some research. I found the commands that I will need to use to implement and make the changes, in theory:

First I need to know what volume groups are on the system, this can be found using the lsvg command:

# lsvg
rootvg
vg04
raweagantsm02
raweagantsm01
raweaganarch

Next I need to know which disks are in each volume group, this can be found using the lspv command (truncated output):

#lspv
hdisk0 00cdfe5b0855e5f5 rootvg active
hdiskpower0 00cdfe5b448b684a vg04 active
hdiskpower13 00cdfe5bd1d8fdd5 raweagantsm02 active
hdiskpower92 00cdfe5b4494c652 raweagantsm01 active
hdiskpower96 00cdfe5b448dddcf raweaganarch active

Next I will need to offline the volume group that I want to rename using the varyoffvg command:

#varyoffvg vg04

Now we need to export the volume group so we can later import it with the new name. To export a volume group use the exportvg command:

#exportvg vg04

Now an lspv would show all disks previously associated with the exported volume as having no volume group:

#lspv
hdisk0 00cdfe5b0855e5f5 rootvg active
hdiskpower0 00cdfe5b448b684a None active
hdiskpower13 00cdfe5bd1d8fdd5 raweagantsm02 active
hdiskpower92 00cdfe5b4494c652 raweagantsm01 active
hdiskpower96 00cdfe5b448dddcf raweaganarch active

Now I can import the old volume group with the new name using the importvg -y command (the -y <volume_group_name> tells the system what to name the new volume group, if this is omitted the system will automatically generate a new one):

#importvg -y raweagantsm03 hdiskpower0 (or any other disk that was part of the volume group)

Now an lsvg should show the new volume group:

# lsvg
rootvg
raweagantsm03
raweagantsm02
raweagantsm01
raweaganarch

Additionally an lspv will show the disk now being part of the new volume group:

#lspv
hdisk0 00cdfe5b0855e5f5 rootvg active
hdiskpower0 00cdfe5b448b684a raweagantsm03 active
hdiskpower13 00cdfe5bd1d8fdd5 raweagantsm02 active
hdiskpower92 00cdfe5b4494c652 raweagantsm01 active
hdiskpower96 00cdfe5b448dddcf raweaganarch active

Hopefully this works the way I think it should. I have spoken with my local AIX guru and told him my plans and everything seems to check out. Once the new disk comes in for the rest of the project I’ll work on implementing the above.