The LV /dev/vgdata/lvdocs is already larger, but ext4 still has its old size.
Grow the filesystem to use the current LV size.
Which command is appropriate?
resize2fs grows ext4 to the available lower block-device size. LV growth and filesystem growth are separate layers.
Detailed explanation
lvextend /dev/vgdata/lvdocsIncorrect. The LV is already extended and this command would not grow ext4.
Incorrect. The LV is already extended and this command would not grow ext4.
xfs_growfs /dev/vgdata/lvdocsIncorrect. xfs_growfs is for XFS, not ext4.
Incorrect. xfs_growfs is for XFS, not ext4.
resize2fs /dev/vgdata/lvdocsCorrect. resize2fs grows ext4 to the LV's current size.
Correct. resize2fs grows ext4 to the LV's current size.
mkfs.ext4 /dev/vgdata/lvdocsIncorrect. mkfs.ext4 recreates the filesystem and destroys existing files.
Incorrect. mkfs.ext4 recreates the filesystem and destroys existing files.
Try it yourself
An example you can run in a temporary verification environment.
resize2fs -h 2>&1 | sed -n '1,12p'Expected result
ext2/ext3/ext4 filesystem resizerの使用法Key points
- resize2fs handles ext filesystems
- LV and filesystem are separate
- Omitting size grows to device size
Notes
- Environment: e2fsprogs resize2fs / ヘルプ表示のみ
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.