Shrink an unmounted LV containing an ext4 filesystem.
Backups are complete and the data fits within the smaller target size.
Which order is appropriate?
Shrink the upper filesystem first, then shrink the underlying LV. Reducing the LV first can cut off blocks still used by the filesystem.
Detailed explanation
Correct. Unmount and check the filesystem, shrink ext4, then reduce the LV.
Correct. Unmount and check the filesystem, shrink ext4, then reduce the LV.
Incorrect. Shrinking the LV first can discard blocks still used by ext4.
Incorrect. Shrinking the LV first can discard blocks still used by ext4.
Incorrect. Removing the VG destroys the existing layout and data.
Incorrect. Removing the VG destroys the existing layout and data.
Incorrect. The layer order and operation directions are unsafe for an existing filesystem.
Incorrect. The layer order and operation directions are unsafe for an existing filesystem.
Try it yourself
An example you can run in a temporary verification environment.
udevadm --help | sed -n '1,10p'Expected result
info、trigger、settle、monitor、test等のudev管理操作Key points
- Shrink upper layers first
- Take a backup and check consistency
- Some filesystems such as XFS cannot shrink
Notes
- Environment: systemd-udev udevadm / ヘルプ表示のみ
- 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.