1823308 Members
3516 Online
109653 Solutions
New Discussion юеВ

Re: How to extend pv?

 
SOLVED
Go to solution
Andrej Vavro
Frequent Advisor

How to extend pv?

Hi guys,

I've created physical volume by pvcreate in time when I had 6 disks in HW RAID. Total amount was about 135GB. Later I've added 4 more disks and pvdisplay can see only original 135GB. Is there any way how to extend pv? I mean instead of backup, pvcreate, vgcreate, lvcreate and restore.

Is on SLES7 and IBM EXP300 storage expansion unit.

Any advice is appreciated.

regards,
Andrej
6 REPLIES 6
Rick Garland
Honored Contributor

Re: How to extend pv?

Does the system see the disks? Is the RAID configuration accounting for these additional disks?

There is not a command to pvextend. You can pvcreate to tell the OS that these disks are part of LVM config. You can do vgextend to put these disks in the same volume group.

The pvcreate command is destructive so make sure you are working with the correct disks.
Stuart Browne
Honored Contributor

Re: How to extend pv?

Go Rick! Go Rick! *cheers!* The perfect answer!

*mumbles 'cause Rick got there first*
One long-haired git at your service...
Steven E. Protter
Exalted Contributor

Re: How to extend pv?

Usually you do this:

vgextend
lvextend < if you need to extend an existing volume group>
extendfs < to extend the current filesystem >

pvcreate is not going to hurt any new disks.

The reason you probably don't recognize the size thats available is because the vgcreate command did not accomodate the current configuration.

To fix that, you have to vgexport the current volume group and re-run the vgcreate command. If in that command you limit the number of physical volumes to significantly less than 255, the maximum, more space will be able to be allocated on existing volume groups.

I can provide specific commands on Monday when I regain access to an HP-UX server.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Andrej Vavro
Frequent Advisor

Re: How to extend pv?

Steven,

Can you please provide more details on suggested solution? Are the existing data going to be lost?

Thanks,
Andrej
Stuart Browne
Honored Contributor
Solution

Re: How to extend pv?

Assuming you don't remove the existing physical volumes (pv's) from the current volume groups (vg's), no existing data should be lost.

If you are at all unsure about what you are doing, standard rule of thumb. Back it up first!

With the 4 disks you added to the RAID container, has the existing RAID container been expanded?

If so, have you created new partitions on the existing container? Or has the new disks been added as a new container?

You create PV's under Linux on filesystems that have been created, or whole physical (or RAID logical) device.

So first step I guess.. What did you actually do with those new 4 disks?

Once you've created a PV with the new space, then you 'vgextend'.

'vgdisplay' will show:

--- Volume group ---
VG Name vgLocal
VG Access read/write
VG Status available/resizable
VG # 0
MAX LV 256
Cur LV 3
Open LV 3
MAX LV Size 255.99 GB
Max PV 256
Cur PV 1
Act PV 1
VG Size 107.88 GB
PE Size 4 MB
Total PE 27617
Alloc PE / Size 27617 / 107.88 GB
Free PE / Size 0 / 0
VG UUID 0sUVMR-PuRI-5Hd0-30m5-jeFl-LX2Q-6JnGGs

The 'PE' values (Physical Extents, which live on Physical Volumes) are how much of the PV's have not yet been assigned to a volume group.

.. I love LVM .. don't you ? :)

NOTES: As listed above, depending on what values for PE size the volume group is created with, depends on how big it can go. 4MB PE's can grow up to 256GB LV's.
One long-haired git at your service...
Andrej Vavro
Frequent Advisor

Re: How to extend pv?

Guys,

sorry for bothering you. It was my mistake. I expected current partition extend somehow. fdisk is the right solution to create 8e partition on free space before playing with LVM.

Andrej