How to reduce LVM Logical Volume size in linux

How to reduce LVM Logical Volume size in linux, reduce lvm, reduce lvm size, reduce lvm size linux, reduce lvm size partition linux, resize logical volume

In this post, We explain you how to reduce the LVM partition size in Linux. We may come across in a situation to reduce the LVM Partition in Linux. Refer this link to create a LVM Partition in Linux and also refer to reduce the partition in linux without LVM.

Assume that, we wanted to reduce the /data by 2GB. But make sure that you have free physical extents of 2Gb, Else we need to move the used extents from one PV to other PV. Refer this link to know how to remove physical volume in linux., Hope you have free physical extends of 2Gb to reduce the logical volume.
[root@linux ~]# df -h /data
Filesystem                            Size       Used    Avail     Used%      Mounted on
/dev/mapper/vg01-lvol0         10G        5.0G    4.9G      50%        /data
Step1 : Umount the filesystem
[root@linux ~]#  umount  /data
Step2 : Check the filesystem for errors using e2fsck command
[root@linux ~]# e2fsck -f /dev/mapper/vg01-lvol0
e2fsck 1.41.12 (17-May-2013)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/mapper/vg01-lvol0: 10/770640 files (0.0% non-contiguous), 2446686/3084288 blocks
Step3 : Reduce the volume size of /data
[root@linux ~]# resize2fs /dev/mapper/vg01-lvol0 8G
resize2fs 1.41.12 (17-May-2013)
Resizing the filesystem on /dev/mapper/vg01-lvol0 to 2021440 (4k) blocks.
The filesystem on /dev/mapper/vg01-lvol0 is now 2021440 blocks long.
Step4 : Reduce the size in LVM using lvreduce command
[root@linux ~]# lvreduce  -L 8G /dev/mapper/vg01-lvol0
  WARNING: Reducing active logical volume to 8.00 GiB
  THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce lvol0? [y/n]: y
  Reducing logical volume Lvol0 to 8.00 GiB
  Logical volume Lvol0 successfully resized
Step5 : Mount the file system and verify the size
[root@linux ~]# mount /home
[root@linux ~]# df -h /home
Filesystem                            Size       Used    Avail     Used%      Mounted on
/dev/mapper/vg01-lvol0          8G         5.0G    2.9G      70%        /data
reduce a lvm, reduce lvm size, reduce lvm size linux, reduce lvm size partition linux, reduce lvm size centos, lvreduce, resize logical volume, reduce lv in linux, reduce lv redhat, reduce lv size, how to reduce lv in linux, how to reduce lv partition
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