LVM extension into new space and partition edits

Michael Butash michael at butash.net
Mon Aug 24 17:20:17 MST 2009


I don't think you want to resize your pv partition, I'm not sure you can
resize it logically.  I have never had to try at least.  I'd recommend
making another partition slice, marking at 8e LVM type, add as a new pv
with pvcreate, add new pv to your existing vg with vgextend, do lvextend
to grow into the new block space added to the vg, and then use
resize_reiserfs /dev/vgname/lvname to online grow it.  This is how I've
added space on disk prior after the fact, and as far as I know done to
obviate the need to mess with the physical volume (hence reducing risk).

Looking for how to resize a pv, doesn't look promising...

http://www.google.com/search?q=resize+pv+partition&ie=UTF-8

Look down a few at the problems.  

-mb

On Mon, 2009-08-24 at 16:49 -0700, Alan Dayley wrote:
> I have lost the web page with the steps to do an extension of an LVM
> into unused disk space.  Let me explain my situation and ask my
> question.
> 
> I have a server with Red Hat Enterprise Linux 5.  It had two 250GB
> hard drives in a hardware RAID 1 mirror.  Working fine.  We needed
> more space, so here is what I did:
> 
> - Bought two identical model and recommended 1TB drives from Dell.
> (It's a Dell server.)
> - Using the RAID control interface, I took one 250GB drive offline.
> - Shutdown the server and removed the 250GB drive.
> - Installed one of the new 1TB drives in place of the 250GB drive just removed.
> - Powered up the RAID controller BIOS interface and commanded a
> rebuild of the mirror from the remaining 250GB drive to the 1TB drive.
> - Booted the system and everything was working.
> - Shutdown the system and removed the second 250GB drive, replacing it
> with the other 1TB drive.
> - Again used the RAID controller BIOS interface to rebuild the mirror
> from the first 1TB drive to the second one.
> - Booted the system and all is working well!
> 
> Except...
> 
> Now the partition table of the mirrored 1TB drives still only has
> partitions to use up to the old 250GBs.  I need to:
> 
> 1 - Update the partition table to expand the last partition into the
> unused 750GB of space.  (parted?)
> 2 - Expand the one or more logical volumes into the new space (lvextend)
> 3 - Expand the file system(s) into the new space (resize2fs)
> 
> I plan to expand /dev/sda5 into the empty space.  It is the last
> partition defined and so the least risky to expand, in my mind.  Here
> is the fdisk output:
> 
> # fdisk -l
> 
> Disk /dev/sda: 248.9 GB, 248999051264 bytes
> 255 heads, 63 sectors/track, 30272 cylinders
> Units = cylinders of 16065 * 512 = 8225280 bytes
> 
>    Device Boot      Start         End      Blocks   Id  System
> /dev/sda1               1           7       56196   de  Dell Utility
> /dev/sda2               8        1052     8393962+  8e  Linux LVM
> /dev/sda3   *        1053        1077      200812+  83  Linux
> /dev/sda4            1078       30272   234508837+   5  Extended
> /dev/sda5            1078       30272   234508806   8e  Linux LVM
> #
> 
> Question
> 
> I am extending into empty space on currently installed drives.  The
> instructions I can find online all seem to assume a new physical drive
> has been added and don't go into the partition issues on step 1 of my
> outline above.  All the utilities and commands that produce LVM
> information do not show the vast, unpartitioned space out there.  So,
> I assume step 1 is needed to open up the unallocated space into one of
> the partitions.
> 
> Am I on the right track, to use "parted" and expand the partition
> definition before expanding a logical volume?  Or am I missing
> something or making something more difficult?
> 
> Alan
> ---------------------------------------------------
> PLUG-discuss mailing list - PLUG-discuss at lists.plug.phoenix.az.us
> To subscribe, unsubscribe, or to change your mail settings:
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
> 



More information about the PLUG-discuss mailing list