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: thezramdevnode you name on the command line has to already exist.zramctlonly creates new/dev/zram<N>nodes when you give her the--findoption. 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--sizeargument 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--helpfor 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/dictionarysets 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 โจ
- Linux kernel documentation <https://docs.kernel.org/admin-guide/blockdev/zram.html> ๐ฆ
โจ 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