About Linux FAQ

Browse More FAQs:

Advertisements

How reduce or shrink Logical Volume on Linux

Posted by Vivek Gite [Last updated: October 6, 2006]

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.

Subscribe to our free e-mail newsletter or RSS feed to get all updates. You can Email this page to a friend.

Related Other Helpful FAQs:

Leave a Reply

We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Copyright © 2006-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.