Artix Linux Forum

Init systems => suite66-archived => Topic started by: capezotte on 27 May 2021, 18:35:48

Title: [SOLVED] Swapfiles not automounting
Post by: capezotte on 27 May 2021, 18:35:48
As I've said in another topic, I've migrated to 66 from runit. I had a setup consisting of a /dev/zram0 and a swapfile.

With these config files, I had zram and the swapfile working on boot:

Code: [Select]
# /etc/modules-load.d/zram.conf
zram
# /etc/udev/rules.d/99-zram.rules
KERNEL=="zram0", ATTR{disksize}="3G" RUN="/usr/bin/mkswap /dev/zram0", TAG+="systemd"
# relevant lines in /etc/fstab
/dev/zram0 none swap defaults,pri=0 0 0
/swapfile none swap defaults,pri=0 0 0

After the suite66 migration, though, the zram module isn't loaded automatically, and the swapfiles seem to be ignored. I have to type this in a root shell:

Code: [Select]
modprobe zram && swapon /dev/zram0 -p 20 && swapon /swapfile -p 0

Output of mount -av:
Code: [Select]
/                        : ignored
/home                    : already mounted
none                     : ignored
none                     : ignored
/tmp                     : already mounted
Title: Re: Swapfiles not automounting
Post by: capezotte on 27 May 2021, 18:42:03
I figured out the "zram not automatically loading" part. The /etc/66/script/modules.sh didn't like the fact that the file had no terminating newline. Still need to figure out why mount ignores my swaps.
Title: Re: Swapfiles not automounting
Post by: ndowens on 27 May 2021, 18:54:37
What does your 66 config look like? /etc/66/service/boot@
Title: Re: Swapfiles not automounting
Post by: capezotte on 27 May 2021, 19:08:07
https://paste.artixlinux.org/view/070ec392

Apparently there's a SWAP= key I missed when setting up 66-env. D'oh. Will try setting it to yes and checking the results.

EDIT:
Code: [Select]
66-env -t boot -e vim boot@system && 66-enable -F -t boot boot@system

and setting SWAP to !yes solved the problem. Should've read the config file more carefully.
Title: Re: [SOLVED] Swapfiles not automounting
Post by: ndowens on 28 May 2021, 01:28:16
BTW I've updated suite66-scripts in testing and used s6's script for module-load, in hope to avoid a possible issue like you had.
Title: Re: [SOLVED] Swapfiles not automounting
Post by: capezotte on 28 May 2021, 12:37:20
The new script in gremlins/suite66-scripts indeed fixes the problem (tested removing the trailing newline in zram.conf and rebooting). Thanks!
Title: Re: [SOLVED] Swapfiles not automounting
Post by: ndowens on 28 May 2021, 13:11:07
The new script in gremlins/suite66-scripts indeed fixes the problem (tested removing the trailing newline in zram.conf and rebooting). Thanks!
Thanks for confirming
Title: Re: [SOLVED] Swapfiles not automounting
Post by: mobinmob on 03 June 2021, 22:49:36
@capezotte Take a look at zramen (https://github.com/atweiden/zramen) for zram configuration - it is very nice  ;)
Title: Re: [SOLVED] Swapfiles not automounting
Post by: ndowens on 03 June 2021, 23:33:55
@capezotte Take a look at zramen (https://github.com/atweiden/zramen) for zram configuration - it is very nice  ;)
Which is also in Universe, both zramen and it's service file