ZRAMCTL(8)

๐ŸŽ€ ZRAMCTL โ€” the zram device wrangler (section 8, system administration bestie) ๐ŸŽ€

okay so real talk, this is zramctl from the util-linux crew, and she's here to set up and control zram devices. let's get into it ๐Ÿ’…


โœจ NAME โœจ

zramctl โ€” set up and control zram devices ๐Ÿฆ‹


โœจ SYNOPSIS โœจ

Get info:

zramctl [options]

Reset zram:

zramctl -r zramdev...

Print name of first unused zram device:

zramctl -f

Set up a zram device:

zramctl [-f | zramdev] [-s size] [-t number] [-a algorithm]

โœจ DESCRIPTION โœจ

so zramctl is your girl for three things, no cap: quickly setting up zram device parameters, resetting zram devices, and querying the status of the zram devices you've already got going. ๐Ÿซถ

If you pass no option at all, she shows you every zram device that has a non-zero size. that's the default vibe. โœจ

Wanna know what output columns exist and what they even mean? hit up --help and she'll give you the whole rundown, iykyk. ๐Ÿ‘‘

okay important thing bestie, listen: the zramdev node you name on the command line has to already exist. zramctl only creates new /dev/zram<N> nodes when you give her the --find option. and it's genuinely possible โ€” honestly it's common โ€” that after a system boot the /dev/zram<N> nodes just haven't been created yet. so don't come for her, okay? ๐Ÿ˜ญ

โœจ OPTIONS โœจ

  • -a, --algorithm lzo|lz4|lz4hc|deflate|842|zstd โ€” picks the compression algorithm used to squeeze data inside the zram device. ๐Ÿ—œ๏ธ
ngl the list of supported algorithms might be a little off, because it depends on your current kernel config. you can get a rough overview by running cat /sys/block/zram0/comp_algorithm, but heads up: that list might also be incomplete too. why? because ZRAM rides on the Crypto API, and if some algorithms got built as modules, it becomes literally impossible to enumerate all of them. ๐Ÿ’€
  • -b, --bytes โ€” print sizes in bytes, not the human-readable format. raw numbers only, periodt. ๐Ÿ”ข
  • -f, --find โ€” finds the first unused zram device for you. and if there's a --size argument hanging around, she'll initialize that device too. ๐ŸŽ€
  • -n, --noheadings โ€” don't print the header line in the status output. minimalist queen. ๐Ÿงš
  • -o, --output list โ€” decides which status output columns get used. if you don't specify an arrangement, a default set is used. use --help for the full list of supported columns. ๐Ÿ‘‘

the default list of columns can be extended if you write list in the +list format, e.g. zramctl -o+COMP-RATIO. slay.

  • --output-all โ€” outputs every single available column. all of them. no holding back. ๐Ÿ’–
  • -p, --algorithm-params parameter... โ€” sets the parameters for whichever compression algorithm you picked. for example, level=9 dict=/etc/dictionary sets the compression level and the pre-trained dictionary. the parameters are algorithm-specific, so know your algorithm bestie. ๐Ÿ“
  • -r, --reset zramdev... โ€” resets the zram device(s) you name. and listen โ€” the settings of a zram device can only be changed after a reset. so reset first, then redecorate. ๐Ÿ’…
  • --raw โ€” uses the raw format for the status output. no glow-up, just data. โญ
  • -s, --size size โ€” creates a zram device of the size you asked for. zram devices are aligned to memory pages, so when your requested size isn't a multiple of the page size, it gets rounded up to the next multiple. and when nothing else is specified, the unit of the size parameter is bytes. ๐Ÿ“

the size argument can be followed by 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" means the same thing as "KiB"). or you can use the decimal ones: KB (=1000), MB (=1000*1000), and so on for GB, TB, PB, EB, ZB and YB. ๐ŸŒˆ

  • -t, --streams number โ€” sets the maximum number of compression streams the device can use. the default is to use all CPUs, and one stream for kernels older than 4.6. ๐Ÿง 
  • -h, --help โ€” displays the help text and exits. ๐Ÿซถ
  • -V, --version โ€” displays the version and exits. โญ

โœจ EXIT STATUS โœจ

zramctl returns 0 on success, and nonzero on failure. that's it, that's the whole mood. ๐Ÿ’€


โœจ FILES โœจ

  • /dev/zram[0..N] โ€” the zram block devices themselves. the main characters. ๐Ÿ‘‘

โœจ EXAMPLE โœจ

these commands set up a zram device with a size of one gigabyte and then use it as a swap device. look how easy she makes it:

# zramctl --find --size 1024M
/dev/zram0
# mkswap /dev/zram0
# swapon /dev/zram0
...
# swapoff /dev/zram0
# zramctl --reset /dev/zram0

ate that fr fr ๐Ÿ”ฅ


โœจ AUTHORS โœจ

Timofey Titovets <nefelim4ag@gmail.com>, Karel Zak <kzak@redhat.com> ๐Ÿ’–


โœจ SEE ALSO โœจ


โœจ REPORTING BUGS โœจ

for bug reports, use the issue tracker <https://github.com/util-linux/util-linux/issues>. ๐Ÿ›


โœจ AVAILABILITY โœจ

the zramctl command is part of the util-linux package, which you can download from the Linux Kernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>. ๐ŸŒธ


and that's the whole thing bestie, we're done here ๐Ÿ’… this was util-linux 2.42.4, dated 2026-09-21, and yes that's the same date as the man page footer so we're keeping it cute and accurate. go forth and compress, queen ๐Ÿ‘‘โœจ

๐Ÿ“ฆ where this page comes from
  • arch rolling: util-linux 2.42.4-1 ยท BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND ISC AND LGPL-2.1-or-later AND LicenseRef-PublicDomain
  • ๐Ÿ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms