Account Links: Cart | Your Account | Logout

Skip to content

Red Hat Knowledgebase

Red Hat Knowledgebase Search:

Updated Within the Last:

New Solutions within the last day New Solutions within the last week New Solutions within the last month

Browse by topics:


Click to View a Topic
Red Hat Enterprise Linux > AS/ES/WS v. 3 > Issue <<  154 of 594 >>

Solution Tools:


Email a Solution Postcard Printer version Submit a comment on this answer Update notifications Request an answer Back

Article Reference

Article ID: 3650
Last update: 05-11-06
Issue:
How do I use e2fsadm to shrink or reduce a partition on an existing Logical Volume on Red Hat Enterprise Linux 3?
Resolution:
This article assumes that you have a system using Logical Volume Manager (LVM) and you have the e2fsadm utility installed. The e2fsadm utility is part of the lvm RPM package and additional information can be found in the e2fsadm man page, man e2fsadm from the command line.

Logical volumes may be resized dynamically while preserving data on the volume if the volume's filesystem supports resizing. You can resize ext2 and ext3 filesystems with the e2fsadm command if the filesystem is based on logical volumes. The e2fsadm command acts as a front-end to the lvextend, lvreduce, and resize2fs commands. The filesystem must be unmounted before it can be resized.

In order to reduce a partition you would need to first unmount the filesystem. Then use the e2fsadm command with the -L or -l to specify the size(L) or number of extents(l), you will use a - (minus) sign when expanding the logical volume.

The following example will reduce the /data partition by 50M. Alternatively, we show how you can reduce the /data partition by 8 extents. The volume group that /data resides on, has the necessary space to allow us to do this. The /data partition exists in the vg0 volume group.

 
# umount /data
# vgdisplay
# e2fsadm -L-50M /dev/vg0/data
# e2fsadm -l -8 /dev/vg0/data
# vgdisplay
      


Note: The vgdisplay command will show information regarding your volume groups. When you have completed your task of extending your partition, you can then remount your partition.

Tip: If your partition is configured in the /etc/fstab, then you should be able to use the mount -a command to remount your partition.


How well did this entry answer your question?


good wrong incomplete out of date
Red Hat Enterprise Linux > AS/ES/WS v. 3 > Issue <<   154  of  594  >>