How reduce or shrink Logical Volume on Linux

by on August 1, 2006 · 10 comments· LAST UPDATED October 6, 2006

in

Q. How do I reduce or shrink Logical Volume on Linux? I am using CentOS Linux. Moreover, I would like to shrink or reduce a partition on an existing Logical Volume.

A. You need to use e2fsadm command. This command allows you resizing of a logical volume containing a mounted or unmounted ext2/ext3 filesystem. Logical volumes can be resized dynamically while preserving data on the volume for both ext2 and ext3 file system.

However, before using any one of the following command, make sure you have backup of all important data/config files.

First, unmount partition. For example if your paritition is called /webroot (vg0 volume group), type the following command:# umount /webrootLet us say you want to reduce size by 1000MB:# e2fsadm -L -1000M /dev/vg0/webrootWhere,

  • -L -1000M: Resize the filesystem/logical volume to or by the given size. If you use + or - then the number will be relative the the current size of the logical volume, otherwise the volume will be resized to LogicalVolumeSize. A size suffix of K for kilobytes, M for megabytes, G for gigabytes or T for terabytes can be used.
  • /dev/vg0/webroot - /webroot is part of vg0 volume (make sure you replace this name with your actual volume)

Now see to see the attributes of volume:# vgdisplayMount the volume:# mount /webrootFor more information read man pages of vgdisplay and e2fsadm.

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 10 comments… read them below or add one }

1 Suresh March 23, 2010 at 5:55 am

It’s totally wrong, there is no such type of command ‘e2fsadm’ in LINUX.
Plz suggest………………………

Reply

2 Tanvir February 5, 2011 at 10:52 am

“e2fsadm” is for kernel 2.4 and less. This command doesn’t work with kernel 2.6. What else could be done?

Reply

3 Anil July 27, 2011 at 2:51 pm

You can look at man pages for following commands
LVM – lvextend, lvresize
Filesystem – resize2fs

Reply

4 Bipin Bahuguna November 4, 2011 at 6:19 am

Hi,

You can reduce lvm size with lvreduce command.

First Step : –> umount /lvmpartition
Second Step : –> e2fsck /lvmpartition
Third Step: –> lvreduce -L100M /lvmpartition

if any issue with linux u can directly contact me on given email address.

Reply

5 Bipin Bahuguna November 4, 2011 at 6:20 am

Hi,

You can reduce lvm size with lvreduce command.

First Step : –> umount /lvmpartition
Second Step : –> e2fsck /lvmpartition
Third Step: –> resize2fs /lvmpartition
Fourth Step: –> lvreduce -L100M /lvmpartition

in previous reply just missed 3rd step.

if any issue with linux u can directly contact me on given email address.

Reply

6 noor parkar March 13, 2012 at 11:21 am

you still missed one more step
First Step : –> umount /lvmpartition
Second Step : –> e2fsck /lvmpartition
Third Step: –> resize2fs /lvmpartition
Fourth Step: –> lvreduce -L100M /lvmpartition

Fifth step –> resize2fs /lvmpartition

note here that after lvreduce , we reduces size of the partition and not of filesystem so we need to excute fifth step as well.
just check it.

Reply

7 Gaurav October 6, 2013 at 6:08 am

I want to increase the size of root partition in ubuntu 12.04 because i am getting the error “System running in low graphics mode”

i tried resize2fs but its not working . it says the requested size is greater than 500000 blocks which is actually the current size of the root partition…

can you please let me know the steps that needs to be followed for increasing size of partition

Reply

8 Vkram January 3, 2012 at 5:14 pm

Reduce LV size in RHEL5.6
This is a right command which reduce the size. No make the LV size 200M

# lvreduce -L -200M /dev/polar/root

Reply

9 linuxlover June 21, 2012 at 5:36 am

Hey Mr. Noor parker so after fifth step do we need to mount it or have to leave it as it is…?because we have unounted it in fifth step.

Reply

10 Gaurav October 6, 2013 at 6:04 am

I have problem in loading GUI of ubuntu 12.04 LTS…Actually i have no space left on /partition and hence this issue is happening…can you please tell me how to resize the root partition. I tried resize2fs but when i do this and specify the size it says you requested a size greater than what exists…

Can you please give me sequence of commands through which this can be performed…as i can’t have GUI i am doing it through terminal when i get “system running in low graphics mode error” i have intel HD graphics

Reply

Leave a Comment

Tagged as:

Previous Faq:

Next Faq: