LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (https://www.linuxquestions.org/questions/red-hat-31/)
-   -   resizing PV does not work (lvm) after resizing partition (https://www.linuxquestions.org/questions/red-hat-31/resizing-pv-does-not-work-lvm-after-resizing-partition-850640/)

deadeyes 12-16-2010 07:25 AM

resizing PV does not work (lvm) after resizing partition
 
Hi all,

I know there are probably alot of threads about lvm however they aren't addressing my problem.

I want to extend the PEs available in a VG. This VG already has LVs and those are active and mounted.
From what I read from the manpages of pvresize this should be perfectly possible.
Code:

pvresize resizes PhysicalVolume which may already be in a volume group and have active logical volumes allocated on it.
I did the following steps and wonder if anyone has the same issue. THe machine where I am talking about is an ESX VM.

1. Resized the vmdk in ESX (+1G)
2. Let the kernel reread the device geometry: echo 1 > /sys/block/sdc/device/rescan
3. fdisk shows me the new size... so far so good
4. I resize the partition using fdisk (remove, recreate) and gave it the 8e type (lvm)
5. wrote config to disk
6. executed partprobe
7. pvresize /dev/sdc

Here it goes wrong!
Pvresize says in the verbose output it sees the same size however at the end it says the pv has been resized.

I have seen when I put volumes "offline" using vgchange -a n vg on a test machine, and then try pvresize it seems to work ok.
:s this is against what is in the manual as it says pvresize should work on online mounted volumes.

Can anyone reproduce this or does anyone knows a fix for this?

Thanks in advance!

smoker 12-17-2010 12:23 AM

When you resize a PV you still have to add the extra extents to the volume and resize the filesystem to use those extents.

chickenjoy 12-17-2010 12:23 AM

Just a question) why would you want to increase the size of a couple of allocated PVs when you can achieve the same by declaring new PVs from new disks; and then adding it to the VG.

deadeyes 12-18-2010 09:17 AM

Quote:

Originally Posted by smoker (Post 4194415)
When you resize a PV you still have to add the extra extents to the volume and resize the filesystem to use those extents.

Quote:

7. pvresize /dev/sdc

Here it goes wrong!
Pvresize says in the verbose output it sees the same size however at the end it says the pv has been resized.
I can't extend a fs, logical volume if I don't have extra space in the pv (pvdisplay).

It keeps showing the old size.

I have been using LVM in the past and am aware that I should extend the LV(lvresize) and the fs(resize2fs).

deadeyes 12-18-2010 09:24 AM

Quote:

Originally Posted by chickenjoy (Post 4194416)
Just a question) why would you want to increase the size of a couple of allocated PVs when you can achieve the same by declaring new PVs from new disks; and then adding it to the VG.

I am aware that I can create extra disks and add them without downtime. However extending the existing ones seem to me as the most clean way to do this.
For me it is more a matter of "why doesn't this work as it should". As the manual clearly states that it should work. And if other people notice the same behaviour on RHEL/Centos or other distributions.
Another way I have been doing this in the past (because I had the same issue) is extending the existing disk, rereading the disk geometry, adding a partition, pvcreate, vgextend. But on a partition point of view this is a bit of junk, as it should be possible to do it in the same partition.

JohnMurrayUK 03-11-2011 11:19 AM

Deadeyes - Did you ever find a way of doing this? I've been attempting the same thing to no avail far.


All times are GMT -5. The time now is 04:37 PM.