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
34 Set the compression algorithm to be used for compressing data in
35 the zram device.
36
37 -f, --find
38 Find the first unused zram device. If a --size argument is present,
39 then initialize the device.
40
41 -n, --noheadings
42 Do not print a header line in status output.
43
44 -o, --output list
45 Define the status output columns to be used. If no output
46 arrangement is specified, then a default set is used. Use --help to
47 get a list of all supported columns.
48
49 --output-all
50 Output all available columns.
51
52 --raw
53 Use the raw format for status output.
54
55 -r, --reset
56 Reset the options of the specified zram device(s). Zram device
57 settings can be changed only after a reset.
58
59 -s, --size size
60 Create a zram device of the specified size. Zram devices are
61 aligned to memory pages; when the requested size is not a multiple
62 of the page size, it will be rounded up to the next multiple. When
63 not otherwise specified, the unit of the size parameter is bytes.
64
65 The size argument may be followed by the multiplicative suffixes
66 KiB (=1024), MiB (=1024*1024), and so on for GiB, TiB, PiB, EiB,
67 ZiB and YiB (the "iB" is optional, e.g., "K" has the same meaning
68 as "KiB") or the suffixes KB (=1000), MB (=1000*1000), and so on
69 for GB, TB, PB, EB, ZB and YB.
70
71 -t, --streams number
72 Set the maximum number of compression streams that can be used for
73 the device. The default is use all CPUs and one stream for kernels
74 older than 4.6.
75
76 -V, --version
77 Display version information and exit.
78
79 -h, --help
80 Display help text and exit.
81
83 zramctl returns 0 on success, nonzero on failure.
84
86 /dev/zram[0..N]
87 zram block devices
88
90 The following commands set up a zram device with a size of one gigabyte
91 and use it as swap device.
92
93 # zramctl --find --size 1024M
94 /dev/zram0
95 # mkswap /dev/zram0
96 # swapon /dev/zram0
97 ...
98 # swapoff /dev/zram0
99 # zramctl --reset /dev/zram0
100
102 Timofey Titovets <nefelim4ag@gmail.com>, Karel Zak <kzak@redhat.com>
103
105 Linux kernel documentation
106 <http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/admin-guide/blockdev/zram.rst>
107
109 For bug reports, use the issue tracker at
110 https://github.com/karelzak/util-linux/issues.
111
113 The zramctl command is part of the util-linux package which can be
114 downloaded from Linux Kernel Archive
115 <https://www.kernel.org/pub/linux/utils/util-linux/>.
116
117
118
119util-linux 2.37.2 2021-06-02 ZRAMCTL(8)