The Linux Newbie Guide  ⇒    Fundamentals     Advanced     Supplement   Command Index   ENG⇒中
All rights reserved, please indicate the source when citing
  

resize2fs - Change the Size of an ext Filesystem



resize2fs is a Linux command used to adjust the size of ext2, ext3, and ext4 file systems. It is typically used to expand or shrink existing ext file systems to accommodate different storage requirements.

resize2fs is generally executed by a superuser, and its syntax is resize2fs [OPTIONS] DEVICE [SIZE]. If you omit "SIZE", it will use the remaining available space.

Common options for resize2fs include:

Example:
# resize2fs -M /dev/sda1 ←To resize the /dev/sda1 file system to match the remaining space on the disk
# resize2fs /dev/sda1 100G ←Expand the '/dev/sda1' file system to 100 GB

Please note that resize2fs may not be applicable to xfs file systems. For xfs-specific commands, please refer to the provided link.