I have an ext4 path that is mounted on a logical volume. How do I shrink this without damaging the ext4 filesystem? I’m using community.general.lvol and noticed it has parameters shrink, resizefs and force. Can I just create one task like this:
- name: Shrink
community.general.lvol:
vg: “{{ vg_name }}”
lv: “{{ lv_name }}”
size: “{{ size }}”
shrink: true
resizefs: true
force: true
Or do I need to create one task each for unmounting the ext4 filesystem, run e2fsck -p -f ext4, shrink ext4 using resize2fs, resize the LV using lvol module with resizefs parameter set to no?