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 --raw Use the raw format for status output.
55
56 -r, --reset
57 Reset the options of the specified zram device(s). Zram device
58 settings can be changed only after a reset.
59
60 -s, --size size
61 Create a zram device of the specified size. Zram devices are
62 aligned to memory pages; when the requested size is not a multi‐
63 ple of the page size, it will be rounded up to the next multi‐
64 ple. When not otherwise specified, the unit of the size parame‐
65 ter is bytes.
66
67 The size argument may be followed by the multiplicative suffixes
68 KiB (=1024), MiB (=1024*1024), and so on for GiB, TiB, PiB, EiB,
69 ZiB and YiB (the "iB" is optional, e.g., "K" has the same mean‐
70 ing as "KiB") or the suffixes KB (=1000), MB (=1000*1000), and
71 so on for GB, TB, PB, EB, ZB and YB.
72
73 -t, --streams number
74 Set the maximum number of compression streams that can be used
75 for the device. The default is one stream.
76
77 -V, --version
78 Display version information and exit.
79
80 -h, --help
81 Display help text and exit.
82
83
85 zramctl returns 0 on success, nonzero on failure.
86
87
89 /dev/zram[0..N]
90 zram block devices
91
92
94 The following commands set up a zram device with a size of one gigabyte
95 and use it as swap device.
96
97 # zramctl --find --size 1024M
98 /dev/zram0
99 # mkswap /dev/zram0
100 # swapon /dev/zram0
101 ...
102 # swapoff /dev/zram0
103 # zramctl --reset /dev/zram0
104
106 Linux kernel documentation ⟨http://git.kernel.org/cgit/linux/kernel/git
107 /torvalds/linux.git/tree/Documentation/blockdev/zram.txt⟩.
108
110 Timofey Titovets <nefelim4ag@gmail.com>
111 Karel Zak <kzak@redhat.com>
112
114 The zramctl command is part of the util-linux package and is available
115 from https://www.kernel.org/pub/linux/utils/util-linux/.
116
117
118
119util-linux July 2014 ZRAMCTL(8)