Linux command
resize2fs 命令
安全
权限或系统影响较大,执行前请核对目标。
常用示例
Example
sudo resize2fs /dev/sdXN
Example
sudo resize2fs -p /dev/sdXN 40G
Shrink
sudo resize2fs -M /dev/sdXN
Force
sudo resize2fs -f /dev/sdXN
说明
resize2fs resizes ext2, ext3, or ext4 filesystems. It can grow or shrink the filesystem. Note that it does not resize the underlying partition; use a partitioning tool for that.
参数
- -b
- Enable 64-bit block numbers
- -d DEBUG-FLAGS
- Enable debugging output
- -f
- Force resize even with errors
- -F
- Flush buffer cache before resize
- -M
- Shrink to minimum size
- -p
- Show progress bar
- -P
- Print minimum size and exit
- -s
- Disable 64-bit block numbers
- -S STRIDE
- Specify RAID stride for optimal placement
FAQ
What is the resize2fs command used for?
resize2fs resizes ext2, ext3, or ext4 filesystems. It can grow or shrink the filesystem. Note that it does not resize the underlying partition; use a partitioning tool for that.
How do I run a basic resize2fs example?
Run `sudo resize2fs /dev/sdXN` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -b do in resize2fs?
Enable 64-bit block numbers