1ZRAMCTL(8) System Administration ZRAMCTL(8)
2
3
4
6 zramctl - set up and control zram devices
7
9 Get info:
10
11 zramctl [options]
12
13 Reset zram:
14
15 zramctl -r zramdev...
16
17 Print name of first unused zram device:
18
19 zramctl -f
20
21 Set up a zram device:
22
23 zramctl [-f | zramdev] [-s size] [-t number] [-a algorithm]
24
25
27 zramctl is used to quickly set up zram device parameters, to reset zram
28 devices, and to query the status of used zram devices.
29
30 If no option is given, all non-zero size zram devices are shown.
31
32 Note that zramdev node specified on command line has to already exist.
33 The command zramctl creates a new /dev/zram<N> nodes only when --find
34 option specified. It's possible (and common) that after system boot
35 /dev/zram<N> nodes are not created yet.
36
38 -a, --algorithm lzo|lz4|lz4hc|deflate|842
39 Set the compression algorithm to be used for compressing data in
40 the zram device.
41
42 -f, --find
43 Find the first unused zram device. If a --size argument is
44 present, then initialize the device.
45
46 -n, --noheadings
47 Do not print a header line in status output.
48
49 -o, --output list
50 Define the status output columns to be used. If no output
51 arrangement is specified, then a default set is used. Use
52 --help to get a list of all supported columns.
53
54 --output-all
55 Output all available columns.
56
57 --raw Use the raw format for status output.
58
59 -r, --reset
60 Reset the options of the specified zram device(s). Zram device
61 settings can be changed only after a reset.
62
63 -s, --size size
64 Create a zram device of the specified size. Zram devices are
65 aligned to memory pages; when the requested size is not a multi‐
66 ple of the page size, it will be rounded up to the next multi‐
67 ple. When not otherwise specified, the unit of the size parame‐
68 ter is bytes.
69
70 The size argument may be followed by the multiplicative suffixes
71 KiB (=1024), MiB (=1024*1024), and so on for GiB, TiB, PiB, EiB,
72 ZiB and YiB (the "iB" is optional, e.g., "K" has the same mean‐
73 ing as "KiB") or the suffixes KB (=1000), MB (=1000*1000), and
74 so on for GB, TB, PB, EB, ZB and YB.
75
76 -t, --streams number
77 Set the maximum number of compression streams that can be used
78 for the device. The default is one stream.
79
80 -V, --version
81 Display version information and exit.
82
83 -h, --help
84 Display help text and exit.
85
86
88 zramctl returns 0 on success, nonzero on failure.
89
90
92 /dev/zram[0..N]
93 zram block devices
94
95
97 The following commands set up a zram device with a size of one gigabyte
98 and use it as swap device.
99
100 # zramctl --find --size 1024M
101 /dev/zram0
102 # mkswap /dev/zram0
103 # swapon /dev/zram0
104 ...
105 # swapoff /dev/zram0
106 # zramctl --reset /dev/zram0
107
109 Timofey Titovets <nefelim4ag@gmail.com>
110 Karel Zak <kzak@redhat.com>
111
113 Linux kernel documentation ⟨http://git.kernel.org/cgit/linux/kernel/git
114 /torvalds/linux.git/tree/Documentation/admin-guide/blockdev/zram.rst⟩.
115
117 The zramctl command is part of the util-linux package and is available
118 from https://www.kernel.org/pub/linux/utils/util-linux/.
119
120
121
122util-linux July 2014 ZRAMCTL(8)