The resize2fs
command is used in Linux to resize ext2, ext3, or ext4 file systems. It allows users to increase or decrease the size of a file system on a partition, making it a crucial tool for managing disk space effectively.
The basic syntax of the resize2fs
command is as follows:
resize2fs [options] [arguments]
-f
: Force the resize operation, even if the filesystem is mounted.-p
: Print progress information while resizing.-s
: Resize the filesystem to the size specified by the partition size.-M
: Reduce the size of the filesystem to the minimum size possible.resize2fs /dev/sda1 20G
resize2fs /dev/sda1
resize2fs -f /dev/sda1
resize2fs -p /dev/sda1
-f
option with caution.e2fsck
before resizing to avoid complications.