1ZRAMCTL(8) System Administration ZRAMCTL(8)
2
3
4
6 zramctl - set up and control zram devices
7
9 Get info:
10 zramctl [options]
11
12 Reset zram:
13 zramctl -r zramdev...
14
15 Print name of first unused zram device:
16 zramctl -f
17
18 Set up a zram device:
19 zramctl [-f | zramdev] [-s size] [-t number] [-a algorithm]
20
22 zramctl is used to quickly set up zram device parameters, to reset zram
23 devices, and to query the status of used zram devices.
24
25 If no option is given, all non-zero size zram devices are shown.
26
27 Note that zramdev node specified on command line has to already exist.
28 The command zramctl creates a new /dev/zram<N> nodes only when --find
29 option specified. It’s possible (and common) that after system boot
30 /dev/zram<N> nodes are not created yet.
31
33 -a, --algorithm lzo|lz4|lz4hc|deflate|842|zstd
34 Set the compression algorithm to be used for compressing data in
35 the zram device.
36
37 The list of supported algorithms could be inaccurate as it depends
38 on the current kernel configuration. A basic overview can be
39 obtained by using the command "cat
40 /sys/block/zram0/comp_algorithm"; however, please note that this
41 list might also be incomplete. This is due to the fact that ZRAM
42 utilizes the Crypto API, and if certain algorithms were built as
43 modules, it becomes impossible to enumerate all of them.
44
45 -f, --find
46 Find the first unused zram device. If a --size argument is present,
47 then initialize the device.
48
49 -n, --noheadings
50 Do not print a header line in status output.
51
52 -o, --output list
53 Define the status output columns to be used. If no output
54 arrangement is specified, then a default set is used. Use --help to
55 get a list of all supported columns.
56
57 --output-all
58 Output all available columns.
59
60 --raw
61 Use the raw format for status output.
62
63 -r, --reset
64 Reset the options of the specified zram device(s). Zram device
65 settings can be changed only after a reset.
66
67 -s, --size size
68 Create a zram device of the specified size. Zram devices are
69 aligned to memory pages; when the requested size is not a multiple
70 of the page size, it will be rounded up to the next multiple. When
71 not otherwise specified, the unit of the size parameter is bytes.
72
73 The size argument may be followed by the multiplicative suffixes
74 KiB (=1024), MiB (=1024*1024), and so on for GiB, TiB, PiB, EiB,
75 ZiB and YiB (the "iB" is optional, e.g., "K" has the same meaning
76 as "KiB") or the suffixes KB (=1000), MB (=1000*1000), and so on
77 for GB, TB, PB, EB, ZB and YB.
78
79 -t, --streams number
80 Set the maximum number of compression streams that can be used for
81 the device. The default is use all CPUs and one stream for kernels
82 older than 4.6.
83
84 -h, --help
85 Display help text and exit.
86
87 -V, --version
88 Print version and exit.
89
91 zramctl returns 0 on success, nonzero on failure.
92
94 /dev/zram[0..N]
95 zram block devices
96
98 The following commands set up a zram device with a size of one gigabyte
99 and use it as swap device.
100
101 # zramctl --find --size 1024M
102 /dev/zram0
103 # mkswap /dev/zram0
104 # swapon /dev/zram0
105 ...
106 # swapoff /dev/zram0
107 # zramctl --reset /dev/zram0
108
110 Timofey Titovets <nefelim4ag@gmail.com>, Karel Zak <kzak@redhat.com>
111
113 Linux kernel documentation
114 <https://docs.kernel.org/admin-guide/blockdev/zram.html>
115
117 For bug reports, use the issue tracker at
118 https://github.com/util-linux/util-linux/issues.
119
121 The zramctl command is part of the util-linux package which can be
122 downloaded from Linux Kernel Archive
123 <https://www.kernel.org/pub/linux/utils/util-linux/>.
124
125
126
127util-linux 2.39.2 2023-08-17 ZRAMCTL(8)