I just learned about zram in class, so I wanted to activate the mode alongside the swap in my manjaro based computer by following these steps:
I installed the systemd-swap
package using pacman:
sudo pacman -Syu systemd-swap
I changed the content of the file /etc/systemd/swap.conf
by removing comments in the following way:
# Entries in this file show the systemd-swap defaults as
# specified in /usr/share/systemd-swap/swap-default.conf
# You can change settings by editing this file.
# Defaults can be restored by simply deleting this file.
#
# See swap.conf(5) and /usr/share/systemd-swap/swap-default.conf for details.
zswap_enabled=0
zram_enabled=1
#zswap_compressor=zstd
#zswap_max_pool_percent=25
#zswap_zpool=z3fold
#zram_enabled=0
#zram_size=$(( RAM_SIZE / 4 ))
#zram_count=${NCPU}
#zram_streams=${NCPU}
#zram_alg=zstd
#zram_prio=32767
swapfc_enabled=1
#swapfc_force_use_loop=0
#swapfc_frequency=1
#swapfc_chunk_size=256M
#swapfc_max_count=32
#swapfc_min_count=0
#swapfc_free_ram_perc=35
#swapfc_free_swap_perc=15
#swapfc_remove_free_swap_perc=55
#swapfc_priority=50
#swapfc_path=/var/lib/systemd-swap/swapfc/
#swapfc_nocow=1
#swapfc_directio=1
#swapfc_force_preallocated=0
#swapd_auto_swapon=1
#swapd_prio=1024
After rebooting i used the command swapon --show
and I get the following:
NAME TYPE SIZE USED PRIO
/dev/sda6 partition 10.7G 0B -2
/dev/zram0 partition 237.7M 0B 32767
/dev/zram1 partition 237.7M 0B 32767
/dev/zram2 partition 237.7M 0B 32767
/dev/zram3 partition 237.7M 0B 32767
/dev/zram4 partition 237.7M 0B 32767
/dev/zram5 partition 237.7M 0B 32767
/dev/zram6 partition 237.7M 0B 32767
/dev/zram7 partition 237.7M 0B 32767
I don't know why i am getting 7 zram partitions !! my guess is that it took all the remaining space in the disk and converted it to zram partitions but i am actually confused.
You can find an image of all the system partitions by clicking on the following link https://ibb.co/2WHXwcx
And finally thank you for your time :D