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.
Incorrect. Shrinking the LV first can discard blocks still used by ext4.
Incorrect. Removing the VG destroys the existing layout and data.
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 / ヘルプ表示のみ
- Prefer read-only inspection or a disposable system when testing hardware commands.
- Device visibility and module behavior depend on the host and virtualization environment.
Foundation review
Place the operation
sysfs supplies attributes; udev evaluates them and performs configured actions.
Check the side effect
Observe events with udevadm before changing a rule.