I configured a zram device which worked fine. But since a while, it doesn't anymore. Don't know why neither when it stopped to work...
Here is my config :
Code: Select all
$ cat /etc/conf.d/zram-init
# zram settings...
# load zram kernel module on start?
load_on_start=yes
# unload zram kernel module on stop?
unload_on_stop=yes
# Number of devices.
# This value is also passed to the kernel module on modprobe.
num_devices=1
# For each device, specify the following variables
# Omitting them is the same as specifying them as empty: It uses defaults
# type0, type1, ... are the variables for the types
# size0, size1, ... are the variables for the sizes (in MB)
# mlim0, mlim1, ... are the variables for the maximal uncompressed memory (MB)
# back0, back1, ... are the variables for the backup device
# maxs0, maxs1, ... are the variables for the maximal (parallel) streams
# algo0, algo1, ... are the variables for the compression algorithms
# flag0, flag1, ... are the variables for the flags
# labl0, labl1, ... are the variables for the label name (if you want some)
# uuid0, uuid1, ... are the variables for the UUID (if you want to force it)
# args0, args1, ... are the variables for additional arguments to zram-init
# (args0, args1, ... are eval'd, so quote correspondingly!)
# notr0, notr1, ... are the flags for "do not trim (discard)" (if nonempty)
# (set notr* to a nonempty value only for linux-3.14 or earlier or when you
# are prepared to waste a lot of memory for a possibly slight speed increase)
# The following are ignored for type swap but not for the other types:
# opts0, opts1, ... are the variables for the mount options
# mode0, mode1, ... are the variables for the directory mode
# owgr0, owgr1, ... are the variables for the directory owner:group
#
# If the size is 0 (or empty) the device is ignored by the script.
#
# Available types:
# "swap" The device is initialized as a swap device.
# The flags variable specifies the priority (16383 if empty).
# Use "-" in the flags variable for the default priority (-1)
# "/..." The device is mounted on /...
# The flags variable specifies the type (ext2, ext4, or btrfs;
# default is ext4)
# "-" The filesystem (specified by flags as above) is created in
# /dev/zram$NUM but not mounted
# Devices with other types are ignored by the script
#
# Only variables with numbers 0 ... num_devices-1 are used by the script.
# swap - 4G
type0=swap
#flag0=10000 # The default "16383" is fine for us
size0=4096
mlim0= # no hard memory limit
back0= # no backup device
notr0= # keep the default on linux-3.15 or newer
maxs0= # maximum number of parallel processes for this device
algo0=zstd # lz4 (since linux-4.18), lz4 (since linux-3.15), or lzo.
# Size: zstd (best) > lzo > lz4. Speed: lz4 (best) > zstd > lzo
labl0=zram # the label name
uuid0= # Do not force UUID
args0= # we could e.g. have set args0="-L 'zram_swap'" instead of using labl0But my zram doesn't really exists :
Code: Select all
$ swapon --show
NAME TYPE SIZE USED PRIO
/dev/sdc4 partition 15G 0B -2
$ zramctl zram0
NAME ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram0 zstd 0B 0B 0B 0B 4
Code: Select all
# LANG=en rc-service zram-init restart
* WARNING: you are stopping a boot service
* Remove zram0 swap [ !! ]
* Unloading zram module... [ ok ]
* Loading zram module... [ ok ]
* Swap->zram0
zramctl: /dev/zram0: failed to reset: Device or resource busy
zram-init:
zramctl zram0 failed [ !! ]



