How to extend / increase a LVM Logical Volume in Linux

lvm extend filesystem, extend lvm partition, extend lvm, resize lvm partition linux, extending a logical volume, how to extend LVM, lvm extend logical volume

Are you looking for How to extend or how to increase a logical volume in linux on lvm. Here we have described the commands to extend a logical volumes on Linux.

Prerequisites:
Ensure that we have enough free space on Volume group (Example : vg01) to extend a Logical Volume using the command.
vgdisplay vg01
or
vgs
How to extend a Logical Volume? or How to increase a logical volume?

Assume that We have filesystem "/dev/vg01/lvol1" with size 40Gb and we need to increase the size by 10Gb.

There are two ways to extend LV.
1. Extend to exact size 50Gb
2. Extend by the size 10Gb

Use "lvextend" command to extend / increase a logical volumes on LVM.

1. Extend to exact size
# lvextend -L50G /dev/vg01/lvol1
lvextend -- extending logical volume "/dev/vg01/lvol1" to 50 GB
lvextend -- doing automatic backup of volume group "vg01"
lvextend -- logical volume "/dev/vg01/lvol1" successfully extended
Above command will extend the logical volume "/dev/vg01/lvol1" to total 50Gb.

2. Extend by the size.
If you want to increase the logical volume by 10Gb additional to existing 40Gb.
# lvextend -L+10G /dev/vg01/lvol1
lvextend -- extending logical volume "/dev/vg01/lvol1" to 50 GB
lvextend -- doing automatic backup of volume group "vg01"
lvextend -- logical volume "/dev/vg01/lvol1" successfully extended
Above command will increase the logical volume "/dev/vg01/lvol1" to total 50Gb.

After extending the logical volume, its mandatory to increase the filesystem in partition table to match. Because now it will show the logical volume size as 50Gb, But when you do "df -h', it wont show you the extended size.

Use resizing tools to increase the filesystem size to match the extended size. For each filesystem, we have different tools.
For ext2/ext3/ext4, use resize2fs command.
resize2fs /dev/vg01/lvol1
For reiserfs, use resize_reiserfs command.
Reiserfs file systems can be resized online.
resize_reiserfs -f /dev/vg01/lvol1
For xfs, use zfs_growfs command.
XFS file systems can be resized online.
xfs_growfs /dev/vg01/lvol1
That all about how to extend or increase a logical volume on LVM. Keywords : lvm extend filesystem, extend lvm partition in linux, extend lvm partition centos 7, extend lvm, resize lvm partition linux, extending a logical volume, how to extend LVM, lvm extend in linux, lvm extend logical volume
August 19, 2016

Post a Comment

[disqus][facebook][blogger]

Contact Form

Name

Email *

Message *

Powered by Blogger.
Javascript DisablePlease Enable Javascript To See All Widget