Systemd-swap Error

Here is the Output…

[sonal@sonal-80e5 ~]$ cat /usr/share/systemd-swap/swap-default.conf
################################################################################
# Defaults are optimized for general usage
################################################################################

################################################################################
# You can override any settings with files in:
# /etc/systemd/swap.conf.d/*.conf
################################################################################

################################################################################
# Zswap
#
# Kernel >= 3.11
# Zswap create compress cache between swap and memory to reduce IO
# https://www.kernel.org/doc/Documentation/vm/zswap.txt

zswap_enabled=1
zswap_compressor=zstd     # lzo lz4 zstd lzo-rle lz4hc
zswap_max_pool_percent=25 # 1-99
zswap_zpool=z3fold        # zbud z3fold (note z3fold requires kernel 4.8+)

################################################################################
# ZRam
#
# Kernel >= 3.15
# Zram compression streams count for additional information see:
# https://www.kernel.org/doc/Documentation/blockdev/zram.txt

zram_enabled=0
zram_size=$(( RAM_SIZE / 4 ))    # This is 1/4 of ram size by default.
zram_count=${NCPU}               # Device count
zram_streams=${NCPU}             # Compress streams
zram_alg=zstd                    # See $zswap_compressor
zram_prio=32767                  # 1 - 32767

################################################################################
# Swap File Chunked
# Allocate swap files dynamically
# For btrfs fallback to swapfile + loop will be used
# ex. Min swap size 256M, Max 32*256M
swapfc_enabled=0
swapfc_force_use_loop=0          # Force usage of swapfile + loop
swapfc_frequency=1               # How often to check free swap space in seconds
swapfc_chunk_size=256M           # Size of swap chunk
swapfc_max_count=32              # Note: 32 is a kernel maximum
swapfc_min_count=0               # Minimum amount of chunks to preallocate
swapfc_free_ram_perc=35          # Add first chunk if free ram < 35%
swapfc_free_swap_perc=15         # Add new chunk if free swap < 15%
swapfc_remove_free_swap_perc=55  # Remove chunk if free swap > 55% && chunk count > 2
swapfc_priority=50               # Priority of swapfiles (decreasing by one for each swapfile).
swapfc_path=/var/lib/systemd-swap/swapfc/
# Only for swapfile + loop
swapfc_nocow=1              # Disable CoW on swapfile
swapfc_directio=1           # Use directio for loop dev
swapfc_force_preallocated=0 # Will preallocate created files

################################################################################
# Swap devices
# Find and auto swapon all available swap devices
swapd_auto_swapon=1
swapd_prio=1024
[sonal@sonal-80e5 ~]$

I think Zram is disabled…

Ok, so you have twice the zram/zswap instructions.
Best is to remove them from the swap.conf.d conf file:

sudo sed -i '/zswap\|zram/d' /etc/systemd/swap.conf.d/myswap.conf

Then

cat  /etc/systemd/swap.conf.d/myswap.conf

should only show the swapfc settings and your thread should be really closed :wink:

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.