Re: can we change max PE per PV (1222 Views)
Reply
Regular Advisor
silusan
Posts: 136
Registered: ‎08-23-2011
Message 1 of 5 (1,282 Views)

can we change max PE per PV

[ Edited ]

trying to add a 72Gb disk to an existing VG : VG01

this VG already has a disk which is 40GB in size.

this VG01 max PE  is just 10495

which is 10495*4MB = 40GB

 

how can I extend this VG and then its LV....? thank you

 hpux 11.31

VG Version                  1.0 (from vgdisplay -v)

 

 

# pvcreate /dev/rdisk/disk7

Physical volume "/dev/rdisk/disk7" has been successfully created.

#

#

# vgextend /dev/vg01 /dev/disk/disk7

vgextend: Warning: Max_PE_per_PV for the volume group (10495) too small for this                                                                                                  PV (18431).

         Using only 10495 PEs from this physical volume.

Volume group "/dev/vg01" has been successfully extended.

Volume Group configuration for /dev/vg01 has been saved in /etc/lvmconf/vg01.conf

#

#                                                                                                f

# vgdisplay -v vg01

--- Volume groups ---

VG Name                     /dev/vg01

VG Write Access             read/write

VG Status                   available

Max LV                      255

Cur LV                      1

Open LV                     1

Max PV                      16

Cur PV                      2

Act PV                      2

Max PE per PV               10495

VGDA                        4

PE Size (Mbytes)            4

Total PE                    20990

Alloc PE                    10495

Free PE                     10495

Total PVG                   0

Total Spare PVs             0

Total Spare PVs in use      0

VG Version                  1.0

VG Max Size                 671680m

VG Max Extents              167920

 

   --- Logical volumes ---

   LV Name                     /dev/vg01/lv1

   LV Status                   available/syncd

   LV Size (Mbytes)            41980

   Current LE                  10495

   Allocated PE                10495

   Used PV                     1

 

 

   --- Physical volumes ---

   PV Name                     /dev/disk/disk5

   PV Status                   available

   Total PE                    10495

   Free PE                     0

   Autoswitch                  On

   Proactive Polling           On

 

   PV Name                     /dev/disk/disk7

   PV Status                   available

   Total PE                    10495

   Free PE                     10495

   Autoswitch                  On

   Proactive Polling           On

 

Honored Contributor
Matti_Kurkela
Posts: 6,271
Registered: ‎12-02-2001
Message 2 of 5 (1,253 Views)

Re: can we change max PE per PV

To get the full capacity of your new disk, you must now use the "vgmodify" command to increase the "Max PE per PV" limit in your VG01.

 

You can pre-analyze the modification (vgmodify -t) while the VG is active, but in order to actually make the change, you must unmount /dev/vg01/lv1 and deactivate the VG before running the vgmodify command.

 

For more details, please read "man vgmodify". Note that if the vgmodify is interrupted during the actual modification, you will need special recovery steps as listed on the man page. (As always, it would be a good idea to make sure you have a good backup before performing the actual modification.)

 

You might now think about the maximum size of the disks you might be adding to this VG in the future, and select the new "Max PE per PV" value so that larger-than-current disks can be accommodated, if possible. However, because your PE size is only 4 MB and VG Version is 1.0, the maximum possible disk size is about 255 GB (maximum Max PE per PV 65535 * 4 MB = 262140 MB, or about 255 GB).

 

If you think you'll want to use larger disks than that in the future, you may have to backup your data, and then completely re-create your VG01, selecting larger values for PE size and Max PE per PV at VG creation time.

The PE size is chosen at VG creation time and cannot be changed later.

 

(Lesson for the future: never accept the default PE size and Max PE per PV values without thinking when creating new VGs. If the filesystem is expected to grow in the future, choose the VG parameters so that you will be able to add larger disks if it becomes necessary.)

MK
Respected Contributor
P Arumugavel
Posts: 328
Registered: ‎02-16-2010
Message 3 of 5 (1,222 Views)

Re: can we change max PE per PV

[ Edited ]

Also note, when you are planning to build a VG think about the pe_size, which determines the physical volume size.  Because the max_pe value is not required to be changed from the default size that is 1016 as it is adjusted automatically to match the physical volume size.

 

For example, your pe_size is 32MB and the max_pe is default value (1016) and you are going to add a physical volume which is 100GB, then the max_pe value will grow automatically to match the 100GB, that means (102400=32*max_pe).

 

It can only grow upto 65535. So the VG can accomodate a physical volue upto (32*65535).

But when you changed the max_pe value from default ( range from 1 to 65535) then this won't work.

And it is only applicable to volume groups version 1.0.

Rgds...

Occasional Visitor
AdminUnixFCC
Posts: 1
Registered: ‎09-11-2014
Message 4 of 5 (272 Views)

Re: can we change max PE per PV

Does anyone know how to change that with VGs version above 2.0?

Frequent Advisor
pooderbill
Posts: 42
Registered: ‎09-13-2013
Message 5 of 5 (257 Views)

Re: can we change max PE per PV

[ Edited ]

For version 2.x, you can increase the maximum size of the VG (vgmodify -a -S) which then increases the maximum number of extents per PV. The max default is 65535 but using vgmodify -a -S ### vg_name can increase this limit way beyond the 65k limit to as much as 33554432 extents per PV. This will allow much larger PVs to be added.

 

That said, using vgcreate without -s pe_size is not good sysadmin practice. It is much better to specify -s 32 or even -s 128 if you think the VG will have larger disks in the future. This applies to all VG versions.

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.