Closed nam1962 closed 4 years ago
You're using an old swap.conf file, I'd remove the file and then reinstall systemd-swap to get a new one (or copy the default one from /usr/share/systemd-swap/swap-default.conf
).
As you can see in the log:
août 04 17:50:42 ordi1 systemd-swap[735]: INFO: swapFC: on-demand swap activation at >7643 MiB memory usage
swapFC will only create the first swapfile when atleast 7643MiB of RAM is used (cached or else), if you wish to create a swapfile at startup regardless you can set swapfc_min_count
to 1.
Thank you for this efficient answer. I created the /etc/systemd/swap.conf.d directory, then the overrides.conf file and with swapfc personal settings I now get :
[me@ordi1 ~]$ systemctl status systemd-swap.service
● systemd-swap.service - Manage swap spaces on zram, files and partitions.
Loaded: loaded (/usr/lib/systemd/system/systemd-swap.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2020-08-04 19:46:57 CEST; 1h 11min ago
Main PID: 6024 (bash)
Status: "Monitoring memory status..."
Tasks: 1 (limit: 14087)
Memory: 266.3M
CGroup: /system.slice/systemd-swap.service
└─6024 bash /usr/bin/systemd-swap start
août 04 19:46:57 ordi1 systemd-swap[6024]: INFO: Load: /etc/systemd/swap.conf.d/overrides.conf
août 04 19:46:57 ordi1 systemd[1]: Started Manage swap spaces on zram, files and partitions..
août 04 19:46:57 ordi1 systemd-swap[6024]: INFO: Zswap: backup current configuration: start
août 04 19:46:57 ordi1 systemd-swap[6024]: INFO: Zswap: backup current configuration: complete
août 04 19:46:57 ordi1 systemd-swap[6024]: INFO: Zswap: set new parameters: start
août 04 19:46:57 ordi1 systemd-swap[6024]: INFO: Zswap: Enable: 1, Comp: zstd, Max pool %: 25, Zpool: z3fold
août 04 19:46:57 ordi1 systemd-swap[6024]: INFO: Zswap: set new parameters: complete
août 04 19:46:57 ordi1 systemd-swap[6024]: INFO: swapD: pickup devices from systemd-gpt-auto-generator
août 04 19:46:57 ordi1 systemd-swap[6024]: INFO: swapD: searching swap devices
août 04 19:46:57 ordi1 systemd-swap[6024]: INFO: swapFC: allocate chunk: 1
[me@ordi1 ~]$ swapon -s
Nom de fichier Type Taille Utilisé Priorité
/var/lib/systemd-swap/swapfc/1 file 262140 0 50
[me@ordi1 ~]$ free
total utilisé libre partagé tamp/cache disponible
Mem: 11758 1629 8451 242 1677 9614
Partition d'échange: 255 0 255
[me@ordi1 ~]$
You might ask, why force a swapfile at startup ? It's for the newbees I do convert to Linux to visualize what happened ;)
Now, I'll have to amend my tuto : https://dolys.fr/forums/topic/optimiser-gestion-ram-swap-linux/
Bonus question : how could one be notified that the script improvements render the .conf obsolete ?
Your package manager should inform you with a .pacnew
.rpmnew
or something alike. Otherwise a new feature should bump the minor version (4.x).
Hi, and thank you for this excellent script that improved all my installs.
I have an issue, I thought was similar to #165 ; I removed the s from swapfc_frequency, now systemd-swap seems to start:
But in fact, no file seem to exist :
Here my .conf :
My install :
Thank you in advance for your advice !