Extending a logical volume at LVM

02/04/2009

Suppose that we have a volume group named VG-TEST and It contains a logical volume named LV-TEST. After adding new physical disk /dev/sdx , we want to give additional 100G space to the LV-TEST logical volume. Following procedure is applied to the server.

In our linux server we have to create a new partition on the disk /dev/sdx. To do that:

# fdisk /dev/sdx

fdisk utility asks for parameters so that we create a new partition sdx1

 

To create physical volume

# pvcreate /dev/sdx1

 

To add physical volume to the volume group VG-TEST

# vgextend VG-TEST /dev/sdx1

 

To extend the logical volume LV-TEST

# lvextend -L+100G /dev/VG-TEST/LV-TEST

+100G means that we add extra 100G to the logical volume

 

We extended the logical volume. Now we should give this space server’s ext3 file system to use it.

# ext2online /dev/VG-TEST/LV-TEST 

Related posts:

  1. Linuxta LVM snapshot ile yedekleme yapmak

Tags: , ,

One Response to Extending a logical volume at LVM

  1. whoseroot on 28/09/2009 at 22:02

    on Red Hat and Centos systems, ext2online is not available. You should use resize2fs:
    # resize2fs /dev/VG-TEST/LV-TEST

    and that will detect, write and resize the ext3 fs, then check via df.

Leave a Reply

Your email address will not be published. Required fields are marked *

*