swapspace failed to create swap files on kernel 5.8
axet opened this issue · 7 comments
Ubuntu bug report, not sure what is causing it.
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1894910
Can we have an option to use fallocate vs dd?
Oct 18 17:45:32 axet-laptop swapspace[20368]: Setting up swapspace version 1, size = 948.4 MiB (994443264 bytes)
Oct 18 17:45:32 axet-laptop kernel: [13395.761365] swapon: swapfile has holes
Oct 18 17:45:32 axet-laptop swapspace[20368]: no label, UUID=5df82e74-d166-4570-9260-4ff42170b025
Oct 18 17:45:32 axet-laptop swapspace[714]: Error: Could not enable swapfile '1': Invalid argument
Adding "zero" into /etc/swapspace.conf works. I'm using 1.14 on debian (10) buster. kernel 5.8, and kernel 5.7 failed to create swap files for some reason. Ubuntu seems also affected, can be a kernel bug.
To clarify, the zero option solves the problem for both kernels on Debian and Ubuntu?
I've tested debian only. Yes it does solve the issue
Just tested Ubuntu 20.04 (LTS 5.4.0-53-generic), with BTRFS as root with compression enabled and "zero" option added in /etc/swapspace.conf:
swapspace 1.14-1
Jun 11 21:14:51 axet-laptop kernel: [ 2152.476784] BTRFS warning (device dm-0): swapfile must not be copy-on-write
Jun 11 21:14:55 axet-laptop systemd[1441]: tracker-store.service: Succeeded.
Jun 11 21:14:55 axet-laptop swapspace[15273]: Setting up swapspace version 1, size = 848,9 MiB (890126336 bytes)
Jun 11 21:14:55 axet-laptop swapspace[15273]: no label, UUID=beba3b5c-729d-49c3-80df-3fd790e30f32
Jun 11 21:14:55 axet-laptop swapspace[11788]: Error: Could not enable swapfile '1': Invalid argument
It failed, probably because BTRFS requires additional swap file configuration (truncate + compression off)
Full BTRFS support was added in 1.15. Could you please test with a newer version?
Note that the zero option was removed in favor of automatic detection in 1.17.
Thanks. 1.15 works.