LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 12-16-2010, 07:25 AM   #1
deadeyes
Member
 
Registered: Aug 2006
Posts: 603

Rep: Reputation: 78
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!
 
Old 12-17-2010, 12:23 AM   #2
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 248Reputation: 248Reputation: 248
When you resize a PV you still have to add the extra extents to the volume and resize the filesystem to use those extents.
 
Old 12-17-2010, 12:23 AM   #3
chickenjoy
Member
 
Registered: Apr 2007
Distribution: centos,rhel, solaris
Posts: 200

Rep: Reputation: 30
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.
 
Old 12-18-2010, 09:17 AM   #4
deadeyes
Member
 
Registered: Aug 2006
Posts: 603

Original Poster
Rep: Reputation: 78
Quote:
Originally Posted by smoker View Post
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).
 
Old 12-18-2010, 09:24 AM   #5
deadeyes
Member
 
Registered: Aug 2006
Posts: 603

Original Poster
Rep: Reputation: 78
Quote:
Originally Posted by chickenjoy View Post
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.
 
Old 03-11-2011, 11:19 AM   #6
JohnMurrayUK
LQ Newbie
 
Registered: Mar 2011
Posts: 1

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LVM Partition Resizing ChairmanMeoww Fedora 6 06-16-2012 06:00 AM
LVM: Resizing the root partition fulat2k Linux - General 6 01-08-2012 04:35 PM
Resizing a Fedora 10 partition (lvm) MetallicaQC Linux - Software 2 01-22-2009 11:42 AM
Resizing an LVM partition oogs Fedora 5 10-24-2008 08:52 PM
resizing non-LVM partition laggerific Linux - Software 1 11-09-2006 06:20 PM


All times are GMT -5. The time now is 02:26 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration