zramctl is used to quickly set up zram device parameters, to
reset zram devices, and to query the status of used zram devices.
If no option is given, all non-zero size zram devices are shown.
Note that zramdev node specified on command line has to already
exist. The command zramctl creates a new /dev/zram<N> nodes only
when --find option specified. It’s possible (and common) that
after system boot /dev/zram<N> nodes are not created yet.
-a, --algorithm lzo|lz4|lz4hc|deflate|842|zstd
Set the compression algorithm to be used for compressing data
in the zram device.
Find the first unused zram device. If a --size argument is
present, then initialize the device.
Do not print a header line in status output.
-o, --output list
Define the status output columns to be used. If no output
arrangement is specified, then a default set is used. Use
--help to get a list of all supported columns.
Output all available columns.
Use the raw format for status output.
Reset the options of the specified zram device(s). Zram
device settings can be changed only after a reset.
-s, --size size
Create a zram device of the specified size. Zram devices are
aligned to memory pages; when the requested size is not a
multiple of the page size, it will be rounded up to the next
multiple. When not otherwise specified, the unit of the size
parameter is bytes.
The size argument may be followed by the multiplicative
suffixes KiB (=1024), MiB (=1024*1024), and so on for GiB,
TiB, PiB, EiB, ZiB and YiB (the "iB" is optional, e.g., "K"
has the same meaning as "KiB") or the suffixes KB (=1000), MB
(=1000*1000), and so on for GB, TB, PB, EB, ZB and YB.
-t, --streams number
Set the maximum number of compression streams that can be
used for the device. The default is use all CPUs and one
stream for kernels older than 4.6.
Display version information and exit.
Display help text and exit.
The following commands set up a zram device with a size of one
gigabyte and use it as swap device.
# zramctl --find --size 1024M
# mkswap /dev/zram0
# swapon /dev/zram0
# swapoff /dev/zram0
# zramctl --reset /dev/zram0
The zramctl command is part of the util-linux package which can
be downloaded from Linux Kernel Archive
<https://www.kernel.org/pub/linux/utils/util-linux/>. This page
is part of the util-linux (a random collection of Linux
utilities) project. Information about the project can be found at
⟨https://www.kernel.org/pub/linux/utils/util-linux/⟩. If you have
a bug report for this manual page, send it to
email@example.com. This page was obtained from the
project's upstream Git repository
2021-08-27. (At that time, the date of the most recent commit
that was found in the repository was 2021-08-24.) If you discover
any rendering problems in this HTML version of the page, or you
believe there is a better or more up-to-date source for the page,
or you have corrections or improvements to the information in
this COLOPHON (which is not part of the original manual page),
send a mail to firstname.lastname@example.org
util-linux 2.37.294-0c7e 2021-08-19 ZRAMCTL(8)