Run "df -h /" to make sure you have some free space available on your root volume. If your root volume is 100% full, you must clean it up by removing some files before you proceed.

Run "vgdisplay" and note which volume groups you actually have.

Run "lvdisplay" and note which logical volumes exist on your system.

Adjust the examples below to match volume/group names.

Example 1: add 10GB to "/" (root) partition

Add 10GB to "root" volume:

lvresize -L +10G /dev/VolGroup00/root

Resize the filesystem that resides on that volume:

resize2fs /dev/VolGroup00/root

Note: resize2fsmay take a while to expand the file system on a large volume, so you may want to open a second terminal and monitor the progress with the following command:

watch df -h

Example 2: set swap to 16GB

Disable all swaps:

swapoff -a

Set swap partition size to 16GB:

lvresize -L 16G /dev/VolGroup00/swap

Resize the swap area to use new volume size:

mkswap /dev/VolGroup00/swap

Enable all swaps:

swapon -a

Example 3: create a new volume "data" of 5GB and mount it as "/data"

Create the mount point:

mkdir /data

Create the volume:

lvcreate -L 5G -n data VolGroup00

Create the filesystem:

mkfs.ext3 /dev/VolGroup00/data

Add the following line to your /etc/fstab:

/dev/VolGroup00/data /data ext3 defaults 0 2

Mount the volume:

mount /data

Example 4: reducing size of existing volume "test"

IMPORTANT:1. Reducing volume size CAN NOT be performed while file system is mounted and may take a LONG time.2. You will need to boot from a Rescue CD in order to be able to reduce the size of a volume which holds root file system.3. Improper reduction of a volume size WILL DESTROY YOUR DATA.

Make sure you have a good backup and plenty of downtime scheduled, as it may take a while to shrink a filesystem.

You have been warned: proceed at your own risk.

First, make sure the file system has enough free space so it can be reduced:

In this example, the minimum logical volume size required is: 34477*4096 = 141217792 bytes. Here, you can make calculations to figure out what your file system final size should be, proceed with caution. It is much safer to shrink a file system to its minimum size instead.

Depending on the current file system size, usage and layout, this may take a LONG time.

MAKE SURE THAT YOUR PLANNED NEW VOLUME SIZE IS GREATER THAN THE SIZE OF THE FILESYSTEM. Keep in mind that LVM allocates space to volumes on Physical Extent (PE) granularity, so you may not be able to get the exact size you want.

In our example, PE size is 4MB, we will have to round up the planned volume size to next larger multiple of 4.

Just to be on a safe side, we strongly recommend you adding some extra "padding", so in this example we will shrink the volume down to 200M, which is greater than BOTH 139M used as reported by df and 141M as calculated in blocks.