Wednesday, November 02, 2005

Extend Logical Volume (LVM)

Logical Volume Manager HOWTO: "5.2 Growing your Logical Volume

The e2fsadm command takes care of this for you. However, it may be useful to understand how to do this manually:

If you have room within your Volume Group, this is a one liner:

# lvextend -L+12M /dev/VolGroup00/LogVol00

# lvextend -L+12M /dev/test/HOWTO
lvextend -- rounding size to physical extent boundary
lvextend -- extending logical volume '/dev/test/HOWTO' to 116 MB
lvextend -- doing automatic backup of volume group 'test'
lvextend -- logical volume '/dev/test/HOWTO' successfully extended

5.3 Growing your Volume Group

This is done with the vgextend utility, and is easy as pie. You first need to create a physical volume. This is done with the pvcreate utility. With this tool, you convert any block device into a physical volume.

After that is done, vgextend does the rest:

# pvcreate /dev/sda1
pvcreate -- physical volume '/dev/sda1' successfully created
# vgextend webgroup /dev/sda1
vgextend -- INFO: maximum logical volume size is 255.99 Gigabyte
vgextend -- doing automatic backup of volume group 'webgroup'
vgextend -- volume group 'webgroup' successfully extended

Please note that in order to do this, your Volume Group needs to be active. You can make it by executing 'vgchange -a y webgroup'. "

0 Comments:

Post a Comment

<< Home