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 extend a partition you will first need to unmount the filesystem, then use the
e2fsadm command with the
-L or
-l options to specify the size(L) or number of extents(l), you will use a + (plus) sign when expanding the logical volume.
The following example will extend the /data partition by 50M. Alternatively, we show how you can extend 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.