HostOnNet Blog

Resize LVM partition with lvreduce

Looking for Linux Server Admin or WordPress Expert? We can help.

lvreduce can be used to reduce logical volume size (lvm).

IMPORTANT: You must resize file system inside LVM or you will lose data stored in file system. Always backup data before you resize lvm partition.

Use resize2fs to resize file system before resizing LVM.

To reduce a LVM partition size, run

[root@kvm ~]# lvreduce -L -700G /dev/mapper/vg_kvm-lv_home
  WARNING: Reducing active logical volume to 164.77 GiB.
  THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce vg_kvm/lv_home? [y/n]: y
  Size of logical volume vg_kvm/lv_home changed from 864.77 GiB (221382 extents) to 164.77 GiB (42182 extents).
  Logical volume lv_home successfully resized.
[root@kvm ~]# 

Here the LVM partition size will get reduced by 700 GB. If original size is 800 GB, after running the command, LVM size will be 100 GB.

If you want to resize LVM partition to a fixed size, use lvresize command.

See lvm

Posted in Linux

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.