resize2fs

From RaySoft

The resize2fs program will resize ext2 or ext3 file systems. It can be used to enlarge or shrink an unmounted file system located on device. If the filesystem is mounted, it can be used to expand the size of the mounted filesystem, assuming the kernel supports on-line resizing.[1]

Documentation

Syntax

resize2fs [PARAMETER ...] DEVICE [SIZE]

Examples

Add 40 GB to the partition /dev/xeon_01/lv_export
umount '/export'
lvextend --size '+40G' '/dev/xeon_01/lv_export'
resize2fs '/dev/xeonn_01/lv_export'
mount '/export'
Add a hard disk to the LVM and to the partition /dev/xeon_01/lv_export
umount '/export'
fdisk '/dev/sdb'

Add a new primary partition with n and use the whole space. Change the partition type to 8e (Linux LVM) with t. Review the changes with p. Save and exit with w.

pvcreate '/dev/sdb1'
vgextend 'xeon_01' '/dev/sdb1'
pvscan
lvextend --extents '+100%FREE' '/dev/xeon_01/lv_export'
resize2fs '/dev/xeon_01/lv_export'
mount '/export'

References

  1. man 8 'resize2fs'