1833780 Members
2494 Online
110063 Solutions
New Discussion

Volume Groups

 
Fernando Silva
New Member

Volume Groups

Can we change a Volume Group, just changing the name, or we have to add a new VGroup to the fisical devices?
4 REPLIES 4
Jeff Schussele
Honored Contributor

Re: Volume Groups

Hi Fernando,

You can just vgexport the VG & vgimport it into a new VG name.
Even though it's not required, make a backup beforehand just to be safe.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Pete Randall
Outstanding Contributor

Re: Volume Groups

Fernando,

You can use vgexport/vgimport to accomplish this.

First export the VG:
vgexport -s -m /tmp/vgXXmap /dev/vgXX

Then create the device files:
mkdir /dev/vgYY
mknod /dev/vgYY/group c64 0xYY0000

Then import the VG
vgimport -s -m /tmp/vgXXmap /dev/vgYY


Note the vgnames in the vgimport command differ for the map name and the actual (new) VG.


Pete


Pete
A. Clay Stephenson
Acclaimed Contributor

Re: Volume Groups

Just do a vgexport, create the new /dev/vgxx directory and the new /dev/vgxx/group device node and do your vgimport. If you are using non-standard LVOL names then you should use -m mapfile for both your vgexport and vgimport to preserve them.

Plan B. If you are using raw devices then simply set up symbolic links to the desired lvols.
If it ain't broke, I can fix that.
Sundar_7
Honored Contributor

Re: Volume Groups

Hi Silva,

1) Unmount the logical volumes

2) Deactivate the volume group

# vgchange -a n /dev/vg02

3) Export the VG

# vgexport -v -s -m /vg02.map /dev/vg02

4) create the files for the new vg

# mkdir /dev/vgnew

# mknod /dev/vgnew c 64 0x050000

# vgimport -v -s -m /vg02.map /dev/vg02

5) Edit /etc/fstab and /etc/lvmrc if required.

-- Sundar.
Learn What to do ,How to do and more importantly When to do ?