How to reduce space in LVM and Increase space in LVM



How to reduce space in LVM and Increase space in LVM

Here in this demo I am reducing the 10GB space from lv_home volume and adding this 10GB space to lv_root volume

Reduce space in the LVM volume

Note: We need to make sure that enough free space is there in the volume where we wanted to reduce the space. other wise we loose the data on the volume.

Before doing any thing 1st we needed to un mount the volume

# umount /home

Needed to check the volume so that we don't loose any data

# e2fsck -f /dev/vg_centos/lv_home

Run this command to reduce the date here I am reducing 10GB space on volume home for that we needed to resize the volume.

# resize2fs /dev/vg_centos/lv_home 10G

Then we needed to reduce the space on the

# lvreduce -L 10G /dev/vg_centos/lv_home

Again check the volume for errors

# e2fsck -f /dev/vg_centos/lv_home

Mount the volume and check the data.

# mount /home

Increase the Size of the Volume on LVM

We will check the space which we just clamed from home partition which should be available on volume group

# vgdisplay

Then we are adding the 10GB space which we clamed from lv_home and adding them to lv_root volume

# lvextend -L+10G /dev/vg_centos/lv_root

Once we added the space to logical volume lv_root we needed to resize the partition so that it will be used on the volume


# resize2fs /dev/vg_centos/lv_root


To check the space increased or not run this command

# df -h



Please comments and suggestions are always welcome.

Keywords: LVM, Reduce the Size, reduce LVM, Increase LVM, Increas volume size 


Comments

Popular posts from this blog

Observium: Configuring Microsoft Windows 2008 Server SNMP Agent

AWS: Introduction to AWS (Amazon Web Services)

System/Server Health Status using PowerShell