Mailing List Archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tlug] LVM2 and resizing partition

Hello all,

  My first active (as opposed to looking at it and just reinstalling
from scratch) contact with LVM2: a CentOS5 installation on a disk in a
MacPro coexisting with the MacOSX and using rEFIt to boot from a small
boot partition /dev/sda3 while the rest of the CentOS is on an
LVM2-managed partition /dev/sda4.

  I want to reduce the partition to make space for another one behind
it (eventually). The partition size is 502GiB and I want to reduce it
to about 200GiB. There are two logical volumes in one logical volume
group: one is 6.3GiB, the other fills the rest of the space.

  So I've used the following executed from a rescueCD to get the large
logical volume down to 200GiB:

  resize2fs -f /dev/VolGroup00/LogVol00 200G
  lvm lvreduce -L200G /dev/VolGroup00/LogVol00

  This seems to work, since lvscan tells me I now have about 299GiB of
free space in the LVM partition. However, I cannot figure out how to
get the partition itself resized. pvresize /dev/sda4 did not seem to
do anything for me (message that it resized one pv, but this seems to
be an LVM term and not the unstructured partition fdisk would see).

I've read that I could use (c)fdisk to delete the partition and then
recreate it at a smaller size. However, I'm unsure if there are
existing tools I should use instead? Any help much appreciated!

I know I also have the problem that I already have 4 primary
partitions and need to create an extended partition if I want more
partitions, I'll try to handle that after I learn how to resize an LVM

Regards, Gernot

Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links