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.
xfs_growfs /dev/vgdata/lvdocsIncorrect. xfs_growfs is for XFS, not ext4.
resize2fs /dev/vgdata/lvdocsCorrect. resize2fs grows ext4 to the LV's current size.
mkfs.ext4 /dev/vgdata/lvdocsIncorrect. 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 / ヘルプ表示のみ
- Prefer help or version output and a disposable device when testing storage commands.
- Formatting, repair, and mount changes can affect data or availability.
Foundation review
Place the operation
Growing an LV and growing its filesystem are separate operations.
Check the side effect
Confirm the lower device size and filesystem support before growing.