1748103 Members
4594 Online
108758 Solutions
New Discussion юеВ

to change the PE in a VG

 
himacs
Super Advisor

to change the PE in a VG

Hi,

i want to change PE size of a newly created VG.
Now the PE size is 4MB.I want to change it to 16MB.

Please help on it.

regards,
himacs
7 REPLIES 7
John McWilliams_1
Frequent Advisor

Re: to change the PE in a VG

Hi - you need to recreate the vg. The size can not be changed once the vg is created.

Cheers John
himacs
Super Advisor

Re: to change the PE in a VG

hi

thanks john
sujit kumar singh
Honored Contributor

Re: to change the PE in a VG

hi Himacs,

John got that correct. The PE Size for the VG is a parameter that can be set only at the time pf creation of a VG and later on if that is to be changed then that means the VG has to be created entirley newly.
If you face that scenario for a VG that already has data on that that means backup of everything on the VG, export that VG and recreate the VG with the new PE Size parameter then create LVs, Create Filesystems on those LVs and restore the data.

however this is a good practice at the time of creating a VG to specify the MAX_PE_PER_PV (option -e of the vgcreate command)to the maximum size that is 65535 so that later on extension of the VG with larger Disks does not pose an issue.

Also set the MAX_PV (-p option)to a high value as 64 or well high than what you see that VG can be having a number of disks in the VG

so in your case you can well use as


#vgcreate -s 16 -e 65535 -p 64 ...


REgards
Sujit
himacs
Super Advisor

Re: to change the PE in a VG

hi

i have tried to recreate the vg using
vgremove to remove the vg.But it was not succesfull.Later i used vgexport for the same.Please anybody tell the purpose of vgexport

Thanks in advance
himacs
himacs
Super Advisor

Re: to change the PE in a VG

The solution i got thro this thread is very useful.
John McWilliams_1
Frequent Advisor

Re: to change the PE in a VG

Hi again

vgexport removes the volume group definition from the server without removing the LVM data from the disks. This allows the disks to be imported to another server and used, as in what happens with a cluster
vgremove will delete the LVM data from the disk.
Cheers John
sujit kumar singh
Honored Contributor

Re: to change the PE in a VG

hello,


vgexport:
----------


1)
#vgexport /dev/vg02
this shall remove from the /etc/lvmtab the entries for vg02
and shall remove the /dev/vg02/* files from the system.

2)#vgexport -f /tmp/vg02_pv_list /dev/vg02

this will do all as in step 1 but also will cerate a file named /tmp/vg02_pv_list that shall list the PVs that are the part of the VG vg02.

3)#vgexport -p -v- s -m /tmp/vg02.map /dev/vg02

-p option for preview Mode.
this shall export the VG in preview mode to cereate a map file (-m option) /tmp/vg02.map and shall not remove the VG entry from /etc/lvmtab or shall not remove the /dev/vg02/* files.

-s option as used in the preview mode creates the Map files with an additional entry of VGID made to the Map file.

remember that -p option does the things in Preview mode and can be done when the VG is active.
Else to export the VG from the system the VG is reqd to be in deactivated condition.



USE of the MAP File:
____________________

the map file as we generate with -m option using the preview mode can be used to import the VG to the other host that wants to use this VG.
This is generally used in the MC Service Guard Secnarios where the VG is to be configured to be accessed from more than one node.

Please see for more information the man pages of te commands vgimport(1M) and vgexport(1M)


REgards
Sujit