Operating System - HP-UX
1824069 Members
3060 Online
109668 Solutions
New Discussion юеВ

LVM extending MAX PE per VG

 
Van Poelvoorde
Occasional Advisor

LVM extending MAX PE per VG

I have the following situation:
A VG named vgtest with one disk of 2GB (/dev/dsk/c3t0d0 - 500 PE)
I want to add a second disk of 4GB (/dev/dsk/c3t0d1) and get the warning there's not enough max. PE per VG.
The disk, however is added, but I only see 2GB of the 4GB.
In the meantime theres data on both disks.
I know I can only change the MAX PE by recreating the VG.
Will following procedure work without loosing any data on my disks?
And if not, can you please suggest another way of working that is as quick and safe as possible:
1. vgexport /dev/vgtest
2. vgcreate /dev/vgtest /dev/dsk/c3t0d1
3. vgextend /dev/vdsk/c3t0d0

thanks in advance, an answer is very urgent!
6 REPLIES 6
melvyn burnard
Honored Contributor

Re: LVM extending MAX PE per VG

Sorry, but he only way to do this is to recreate your VG with the changed parameters.
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
MARTINACHE
Respected Contributor

Re: LVM extending MAX PE per VG

Hi,

Yes, this will work but if you want to add a 8GB disk next week, you will get the same problem.

In vgcreate, use the "-s" parameter in order to modify the max pe per pv value.

Give it a value which allox you to add 9 or 18 GB disks
Patrice MARTINACHE
Van Poelvoorde
Occasional Advisor

Re: LVM extending MAX PE per VG

But, I do recreate my VG don't I ?
So, does that mean that my procedure will work?
Sorry, it's still not clear for me, can you please give me the detailed commands to use in my particular case.
Thanks anyway for the fast reply!!!
melvyn burnard
Honored Contributor

Re: LVM extending MAX PE per VG

Your question has also been answered in the comp.sys.hp.hpux newsgroup.

Basically you will need to backup your data, remove the VG and then recreate it.
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
Carlos Fernandez Riera
Honored Contributor

Re: LVM extending MAX PE per VG

Your procedure will not work.

If your vg is not root vg (vg00):

Create a new VG with your new disk.

Create all lvols as they are in your old vg

copy from old to new using dd
# dd if=/dev/oldvg/rlvol1 of=/dev/newvg/rlvol1 bs=1024k

vgexport both vg

mkidr /dev/oldvg
mknod /dev/oldvg/group c .......

vgimport /dev/oldvg /dev/dsk/newdisk.

Do all this in single user.

Boot again and test that all is OK.
Then you can pvcreate -f olddisk and vgextend .


If your vg is vg00 use make_recovery;

unsupported
Manju Kampli
Trusted Contributor

Re: LVM extending MAX PE per VG

as there are large disks are out in the market, you must keep it in mind that, one fine day you will be adding larger disks in to your systems like 36Gb OR even more.
So you need to make decission how big the disks will be added to this VG in the near future and create VG with proper value to MAX PE perf VG.
NOTE: you may think I will just give a number which will allow me to add 100GB disk in future, but this is going to consume some disk space in each volume of the voulme group.. so by giving any large number for MAX PE will waste the diskspace..

So pick number which is more realistic

HTH
Manju
Never stop "LEARNING"