You are not logged in.
As the title says,my system information is follows,wiki isn't tell me how to set
jiaoyuan:~ > cat /proc/swaps
Filename Type Size Used Priority
jiaoyuan:~ > zgrep CONFIG_ZSWAP_DEFAULT_ON /proc/config.gz
CONFIG_ZSWAP_DEFAULT_ON=y
jiaoyuan:~ > cat /sys/module/zswap/parameters/enabled
N
jiaoyuan:~ > cat /proc/cmdline
root=PARTUUID=11434434-65bd-477e-b594-da90cc0c91c5 zswap.enabled=0 rootflags=subvol=@ rw rootfstype=btrfs
jiaoyuan:~ > sudo dmesg | grep zswap
[ 0.000000] Command line: root=PARTUUID=11434434-65bd-477e-b594-da90cc0c91c5 zswap.enabled=0 rootflags=subvol=@ rw rootfstype=btrfs
[ 0.055065] Kernel command line: root=PARTUUID=11434434-65bd-477e-b594-da90cc0c91c5 zswap.enabled=0 rootflags=subvol=@ rw rootfstype=btrfs
jiaoyuan:~ > cat /sys/module/zswap/parameters/enabled
N
jiaoyuan:~ >
Last edited by imjiaoyuan (2026-04-23 01:46:17)
Offline
1)zswap needs a real swap partition
2)zswap.enabled=0 in the kernel cmdline explicitely disables it.
Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !
Offline
1)zswap needs a real swap partition
https://wiki.archlinux.org/title/Swap#Swap_file will do as well, but physical swap is mandatory. Do not try to use zswap along zram
Offline
1)zswap needs a real swap partition
2)zswap.enabled=0 in the kernel cmdline explicitely disables it.
how to finish step2?I use systemd but the wiki use grub
Offline
"grub" is a bootloader, "systemd" is a kitchen sink.
Iff you're using "systemd-boot", see https://wiki.archlinux.org/title/System … figuration
Offline
"grub" is a bootloader, "systemd" is a kitchen sink.
Iff you're using "systemd-boot", see https://wiki.archlinux.org/title/System … figuration
I slved it ,thanks very much
Offline
Perhaps you could post how you solved it so that this thread might be useful in the future for somebody with the same issue as you
Offline
Perhaps you could post how you solved it so that this thread might be useful in the future for somebody with the same issue as you
good idea!
https://jiaoyuan.org/posts/2026-04-22-a … ckup-swap/
I post it on my blog, I finish it as follows:
Create an empty file
sudo truncate -s 0 /swapfile
Set the no‑COW attribute
sudo chattr +C /swapfile
Allocate the desired size
sudo fallocate -l 16G /swapfile
Set correct permissions
sudo chmod 600 /swapfile
Format as swap
sudo mkswap /swapfile
Enable the swap file:
sudo swapon /swapfile
swapon --show
Add it to fstab:
echo '/swapfile none swap defaults 0 0' | sudo tee -a /etc/fstab
Now the physical swap space is ready. Next, add kernel boot parameters. I use systemd‑boot with a UKI, so kernel parameters are configured by editing the kernel command line file /etc/kernel/cmdline. The contents of this file are read by mkinitcpio and packed into the UKI:
sudo nano /etc/kernel/cmdline
Append the zswap parameters at the end:
root=PARTUUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx rw loglevel=3 zswap.enabled=1 zswap.compressor=zstd zswap.max_pool_percent=25
Finally, pack the new parameters from /etc/kernel/cmdline into the kernel:
sudo mkinitcpio -P
Reboot. Verify that zswap is enabled:
jiaoyuan:~ > cat /sys/module/zswap/parameters/enabled
Y
jiaoyuan:~ > free -h
total used free shared buff/cache available
Mem: 30Gi 8.0Gi 17Gi 2.1Gi 7.8Gi 22Gi
Swap: 15Gi 0B 15Gi
Offline