1832678 Members
2779 Online
110043 Solutions
New Discussion

Re: New disk to VG

 
SOLVED
Go to solution
Sanjay Tailor
Frequent Advisor

New disk to VG

Hello,

I have a 4 GB disk that I use for my database application. When the VG was first created, no options were used. I want to add a new 9 GB disk to this VG. My questions is: will the VG recognize the larger size drive.

Are there any other potential problems I should be aware of.

Thanks for your help.
Sanjay
20 REPLIES 20
Rick Garland
Honored Contributor

Re: New disk to VG

Should have no trouble. Do the vgextend for the new disk to be placed in an existing VG.
Rita C Workman
Honored Contributor

Re: New disk to VG

The size of the new disk shouldn't be an issue. Go ahead and do the vgextend and put it into the vol_group. Then source it out as you need..
Regards,
Stefan Farrelly
Honored Contributor

Re: New disk to VG


You may have a problem here. When your 4Gb drive was added to a VG it determines the value of Max PE per PV, which would be around 1024 for the 4Gb drive. Now, when you try to add a larger drive you want max PE per PV to be 9Gb/4 (if your PE size is default 4Mb), which is around 22-2500.

So, do a vgdisplay on the VG with the 4Gb drive. What is max PE per PV set to ? if only 1024 or so then you wont be able to add the 9Gb drive to this VG and use all of it. You will need to rebuild you VG with a higher max PE per PV, or add it to a new VG.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Kofi ARTHIABAH
Honored Contributor

Re: New disk to VG

You should have no problems ... just do a:

vgextend vg_name pv_name

man on vgextend has some examples.

Note however that if you are going to have largefiles (>2G) in a filesystem, then the filesystem should have largefiles enabled with fsadm - do a man on fsadm and fsadm_vxfs
nothing wrong with me that a few lines of code cannot fix!
Cheryl Griffin
Honored Contributor

Re: New disk to VG

Sanjay,

If the volume group was first created with the 4 gig disk and no options were used, the default max_pe is 1016 which with the default pe size of 4, equates to a 4 gig disk.

This means that you can not extend a 9 gig into the volume group because you will not hve enough max_pe.

The volume group will have to be recreated with a larger max_pe to accomodate the 9 gig disk.

Best Wishes,
Cheryl
"Downtime is a Crime."
Antoanetta Naghiu
Esteemed Contributor

Re: New disk to VG

Add the disk, pvcreate to create the physical volume, vgextend it. No problem. As an alternative, you can use sam.
Good luck
Devbinder Singh Marway
Valued Contributor

Re: New disk to VG

You need to check what the Physical Extent size (PE) of the volume group you want to add this disk into is i.e. 4meg, 8meg 16 etc..

When creating the volume group , you can specify the maxium PE size , the default is 1016 , however if the max pe size is reached and you haven't specified the -e max_pe value this will adjust itself ( values range from 1 to 65535 )
e.g. if your volume group was created with PE size of 4 , divide 9gig by 4 and see what
the range is ( should be 1 to 65535) ,

One thing you can try is pvcreate the disk ( make it usable by LVM) and then vgextend it to the volume group , then try writing data
to it , as a test.


hope this helps



Seek and you shall find
Sanjay Tailor
Frequent Advisor

Re: New disk to VG

HMMM!! I seem to be getting conflicting answers. My max PE per PV is 1024. So I cannot add the 9gb drive to the VG? Is that right? How could I solve this problem? Recreate the V? How?

Thanks
Sanjay.
Cheryl Griffin
Honored Contributor

Re: New disk to VG

Sanjay,

You must divide your PE size into the max_pe to determine the size disk your volume is capable of handling.

Otherwise it will result in an error message that states, "you have #### pe's, need ####" and it will fail. OR the disk will be extended into the group and you will not be able to access the last 5 gig (depending on your LVM patch level.

Cheryl
"Downtime is a Crime."
John Palmer
Honored Contributor

Re: New disk to VG

pvcreate the new disk and use vgextend to add it to the volume group.

vgextend is capable of automatically increasing the Max PE per PV (but only up to a certain value).

Go ahead and do it, it won't do any harm. Then use vgdisplay -v to see what you've got.

You can always remove the disk with vgreduce.

Regards,

John
Rick Garland
Honored Contributor

Re: New disk to VG

There are certain HW devices where having different size disks can be an issue. However, you have not specified that this is one of those devices. As John previously stated, the vgextend command will do some of the work for you and you should have no troubles. If you are not able to see the remaining 5 GB, vgreduce the disk out. You may also be on a HW device that does care about having disk sizes be the same.
Sanjay Tailor
Frequent Advisor

Re: New disk to VG

Rick,

How do I know if the different sizes will cause a problem? I have a D370 with 4 internal SCSI differnetial drives. I have Hp-UX 10.20 and I am pretty up to date with my patches.

Thanks
Sanjay.
Rick Garland
Honored Contributor

Re: New disk to VG

Devices that do HA (i.e., AutoRAID) will have this problem. In the docs for these HW devices it tells you to use disks of the same size or you will only see what the smallest disk is in the device.

You specified that you are working off internal disks of a D class system. As previously stated, if you are patched, the vgextend command will do some of the work for you.
Cheryl Griffin
Honored Contributor

Re: New disk to VG

Sanjay,

It would be interesting to know the results of the extend. Be sure to keep us posted.
"Downtime is a Crime."
James R. Ferguson
Acclaimed Contributor

Re: New disk to VG

Sanjay:

You probabably don't have the extendability you're looking for as Cheryl indicates.

Take a look at:

http://us-support2.external.hp.com/cki/bin/doc.pl/sid=82f0e7241350e78d0e/screen=ckiDisplayDocument?docId=200000046942437

...JRF...
Cheryl Griffin
Honored Contributor

Re: New disk to VG

There are a couple of references in this thread to vgextend automatically increasing max_pe, which is simply not the case.

max_pe is set with vgcreate and will be automatically increased only with vgcreate if used on a disk larger than the defaults of PE=4 X max_pe=1016. For instance, if a 9 gig disk was used during the vgcreate, max_pe would be automatically increased to accomodate the larger disk. This number is determined by taking the PE size and dividing it by the total gig of the disk = max_pe.

There was a LVM thread from 7/20 that began a lengthy discussion on this topic. See "Default max PE - any methodology changes coming?" from Tim Malnati.

Best Wishes,
Cheryl
"Downtime is a Crime."
Dan_4
Advisor
Solution

Re: New disk to VG

*****************************************

I'm not sure if Sanjay has gotten the answer he needs, so here it is as plain as I can state it. And believe me, I know, because I answer this question constantly :)

When you create a VG under, if you don't specify any options other than the normal disk name and vgname, then the MAX PE per PV will be set to the equivalent of either 4G or the largest disk in the VG (at time of creation).

This means that if you create a VG with only 1G, 2G, or 4G disks in it, then no disk added to that VG will ever have more than 4G of usable space.

If you create a VG with a 2G and an 18G, then you can add disks up to 18G later without losing any space.

The Max PE per PV number is built into the structure of the LVM headers on the disk and CANNOT be changed after the fact. The VG must be recreated from scratch if you wish to use larger disks later.

**********

To avoid this problem, use the -e option with your vgcreate to increase the MAX PE per PV from the get-go.

However, do not assume that you should set this number very large as a matter of course. The larger the number you use, the larger your header/LVM structure will be. This takes up disk space and has an upper limit (effectively), so there's no point in using a value that would accommodate a 48G disk if you don't really expect to ever have anything larger than an 18G in that VG.

I hope this answers you question :)
Wodisch
Honored Contributor

Re: New disk to VG

Hello Sanjay,
I am pretty shure you *will* have problems adding a 18GB disk. The default for
a "small" VG is 1016 PE of 4MB each, and only up to 16 PVs. That is way to
few space for today's disks! In my experience it is much better to create the VGs
with bigger, but fewer PEs, more PVs, and less LVs (who needs 256 filesystems?),
i.e. for data VGs something like:
vgcreate -s 64 -e 1024 -p 64 -l 64 /dev/vgXX ...
and for root&boot VGs like:
vgcreate -s 64 -e 1024 -p 4 -l 16 /dev/vg00 ... (during installation)
The bad news are: you will have to re-install your whole OS! Try "Ignite/UX"
with the command "make_recovery -Aiv", boot from that tape, and boot from
that tape. Then change the LVM setup, and restore to the "new" disk,
leaving the "old" untouched.
Boot from the new disk, "vgimport" your data VGs, relax ;-)
HTH,
Wodisch
Wodisch
Honored Contributor

Re: New disk to VG

Hello Sanjay,
I am pretty shure you *will* have problems adding a 18GB disk. The default for
a "small" VG is 1016 PE of 4MB each, and only up to 16 PVs. That is way to
few space for today's disks! In my experience it is much better to create the VGs
with bigger, but fewer PEs, more PVs, and less LVs (who needs 256 filesystems?),
i.e. for data VGs something like:
vgcreate -s 64 -e 1024 -p 64 -l 64 /dev/vgXX ...
and for root&boot VGs like:
vgcreate -s 64 -e 1024 -p 4 -l 16 /dev/vg00 ... (during installation)
The bad news are: you will have to re-install your whole OS! Try "Ignite/UX"
with the command "make_recovery -Aiv", boot from that tape, and boot from
that tape. Then change the LVM setup, and restore to the "new" disk,
leaving the "old" untouched.
Boot from the new disk, "vgimport" your data VGs, relax ;-)
HTH,
Wodisch
Wodisch
Honored Contributor

Re: New disk to VG

Hello Sanjay,
I am pretty shure you *will* have problems adding a 18GB disk. The default for
a "small" VG is 1016 PE of 4MB each, and only up to 16 PVs. That is way to
few space for today's disks! In my experience it is much better to create the VGs
with bigger, but fewer PEs, more PVs, and less LVs (who needs 256 filesystems?),
i.e. for data VGs something like:
vgcreate -s 64 -e 1024 -p 64 -l 64 /dev/vgXX ...
and for root&boot VGs like:
vgcreate -s 64 -e 1024 -p 4 -l 16 /dev/vg00 ... (during installation)
The bad news are: you will have to re-install your whole OS! Try "Ignite/UX"
with the command "make_recovery -Aiv", boot from that tape, and boot from
that tape. Then change the LVM setup, and restore to the "new" disk,
leaving the "old" untouched.
Boot from the new disk, "vgimport" your data VGs, relax ;-)
HTH,
Wodisch