I have installed Endeavouros using a customized partitioning table with BTRFS as the root filesystem. However I forgot about adding a subvolume for swap with a swapfile in the mount.conf configuration script.
So I decided to create those after installation following the advise in this eos blogpost and the advise from this post on the forum for initializing the entire swap subvolume with chattr to disable CoW. This already was my second attempt to create a swapfile and at first everything seemed to be working just fine. However lately I noticed some fail statements at startup so when I issued the journalctl -b 0
command I found out the swapfile failed to activate on boot, here’s a snippet:
Apr 25 18:00:27 endeavouros swapon[642]: swapon: /swap/swapfile: swapon failed: Invalid argument
Apr 25 18:00:27 endeavouros kernel: BTRFS warning (device dm-0): swapfile must not be copy-on-write
Apr 25 18:00:27 endeavouros systemd[1]: Mounting /home/ejan/.pki...
Apr 25 18:00:27 endeavouros systemd[1]: Mounting /home/ejan/.var...
Apr 25 18:00:27 endeavouros systemd[1]: Starting Flush Journal to Persistent Storage...
Apr 25 18:00:27 endeavouros systemd[1]: swap-swapfile.swap: Swap process exited, code=exited, status=255/EXCEPTION
Apr 25 18:00:27 endeavouros systemd[1]: swap-swapfile.swap: Failed with result 'exit-code'.
Apr 25 18:00:27 endeavouros systemd-journald[620]: Time spent on flushing to /var/log/journal/2724a86529e441c9a43d>
Apr 25 18:00:27 endeavouros systemd-journald[620]: System Journal (/var/log/journal/2724a86529e441c9a43d877c815a01>
Apr 25 18:00:28 endeavouros systemd-journald[620]: Received client request to flush runtime journal.
Apr 25 18:00:28 endeavouros systemd-journald[620]: /var/log/journal/2724a86529e441c9a43d877c815a0142/system.journa>
Apr 25 18:00:28 endeavouros systemd-journald[620]: Rotating system journal.
Apr 25 18:00:27 endeavouros systemd-udevd[641]: Using default interface naming scheme 'v253'.
Apr 25 18:00:28 endeavouros kernel: BTRFS info: devid 1 device path /dev/mapper/luks-837b6695-6ef2-4fc7-8c0b-432e5>
Apr 25 18:00:28 endeavouros kernel: BTRFS info: devid 1 device path /dev/dm-0 changed to /dev/mapper/luks-837b6695>
Apr 25 18:00:27 endeavouros systemd[1]: Failed to activate swap /swap/swapfile.
Apr 25 18:00:27 endeavouros systemd[1]: Dependency failed for Swaps.
Apr 25 18:00:27 endeavouros systemd[1]: swap.target: Job swap.target/start failed with result 'dependency'.
Which was mind boggling to me since to my knowledge I disabled CoW already on the entire swap directory. This is the output of lsatrr
:
ejan@endeavouros ~> sudo lsattr /swap
[sudo] password for ejan:
---------------C------ /swap/swapfile
ejan@endeavouros ~> sudo lsattr /swap/swapfile
---------------C------ /swap/swapfile
These are the mountpoints I added in fstab
:
/dev/mapper/luks-837b6695-6ef2-4fc7-8c0b-432e584e089c /swap btrfs subvol=/@swap,defaults,noatime 0 0
/swap/swapfile swap swap defaults 0 0
And a listing of my btrfs subvolumes:
ID 256 gen 20456 top level 5 path @
ID 257 gen 20457 top level 5 path @home
ID 258 gen 19842 top level 5 path @cache
ID 259 gen 20457 top level 5 path @log
ID 260 gen 19241 top level 5 path @srv
ID 261 gen 20437 top level 5 path @var-tmp
ID 262 gen 20435 top level 5 path @snapshots
ID 263 gen 20436 top level 5 path @home-snapshots
ID 264 gen 20446 top level 257 path @home/.cache
ID 265 gen 19259 top level 257 path @home/.pki
ID 266 gen 19835 top level 257 path @home/.var
ID 268 gen 19241 top level 5 path @swap
What am I missing? Your insights are welcome.