Resizing ext4 partition centos 5

On CentOS 5 the e4fsprogs RPM provides a separate binary (/sbin/resize4fs) for resizing ext4 partitions.

# rpm -qf /sbin/resize2fs
# rpm -qf /sbin/resize4fs

As I found out today when resizing an LVM partition on one of our mongodb snapshot systems.

# lvextend -L+50G /dev/mapper/mongo
Extending logical volume mongo to 150.00 GB
Logical volume mongo successfully resized
# resize2fs /dev/mapper/mongo
resize2fs 1.39 (29-May-2006)
resize2fs: Filesystem has unsupported feature(s) while trying to open /dev/mapper/mongo
Couldn’t find valid filesystem superblock.

Having alook around I noticed the resize4fs binary which resized it successfully.

# resize4fs /dev/mapper/mongo
resize4fs 1.41.9 (22-Aug-2009)
Filesystem at /dev/mapper/mongo is mounted on /var/lib/mongodb; on-line resizing required
old desc_blocks = 7, new_desc_blocks = 10
Performing an on-line resize of /dev/mapper/mongo to 39321600 (4k) blocks.

Leave a Reply

Your email address will not be published. Required fields are marked *