Closed rvdlinden closed 7 months ago
Files identified in the description:
If these files are inaccurate, please update the component name
section of the description or use the !component
bot command.
cc @MorrisA @abulimov @bcoca @d-little @flynn1973 @gforster @jhoekx @kairoaraujo @marvin-sinister @mator @molekuul @pilou- @ramooncamacho @wtcross click here for bot help
There is currently no way/tool to resize a swap filesystem. Once the underlying device (disk partition, Logical Volume or regular file) containing the swap fs has been expanded, the only way to make the swap fs fill the new free space is to replace it by a new one.
So, yes, there is a bug in filesystem
module claiming that it supports resizing swap filesystem. But for me, this is all about the documentation, not about the implementation itself. Maybe lvol
module should list filesystem types supported by its resizefs
option too (by the way, lvol
module calls lvreduce and lvextend commands with the --resizefs option, that internally calls fsadm, which supports only ext2/3/4, reiserfs and xfs types).
That said, resizing of swap fs could be:
- name: create swap filesystem (forced to ensure it fills the available space)
community.general.filesystem:
dev: /dev/vg.root/lv.paging00
resizefs: true
force: true
To not fail, this requires the swap area not be in use.
Also, original label (if any) and uuid of the filesystem are lost, that may break tools based on them (as in fstab, entries such as UUID=11a81daa-7fdf-46bd-896a-f7f37a3d477f none swap sw 0 0 will not work anymore).
That means that implementing swap resizing can't be expected from lvol
module, and implementing it in filesystem
module requires at least to run:
Sounds more like a feature request than a bug report :)
cc @unkaputtbar112 @zigaSRC click here for bot help
Files identified in the description:
If these files are incorrect, please update the component name
section of the description or use the !component
bot command.
SUMMARY
Unable to resize a swap filesystem on RHEL 7/8 using either the filesystem module nor the lvol module.
The filesystem module states in it's documentation that it can resize a swap partition since 2.8 When used however, the following message is shown:
"msg": "module does not support resizing swap filesystem yet."
When using the lvol module, resizing swap also fails with a message like
"msg": "Unable to resize lv.paging00 to 4g", "rc": 5
NOTE: This issue was already reported early this year as https://github.com/ansible/ansible/issues/67860, but got closed by the ansibot,
ISSUE TYPE
COMPONENT NAME
filesystem module: resizefs parameter lvol module: resizefs parameter
ANSIBLE VERSION
CONFIGURATION
Default
OS / ENVIRONMENT
STEPS TO REPRODUCE
EXPECTED RESULTS
resizing of swap: /dev/vg.root/lv.paging00
ACTUAL RESULTS