]>
Commit | Line | Data |
---|---|---|
295b3979 | 1 | //po4a: entry man manual |
b9d2ddfb MB |
2 | = zramctl(8) |
3 | :doctype: manpage | |
4 | :man manual: System Administration | |
5 | :man source: util-linux {release-version} | |
6 | :page-layout: base | |
7 | :command: zramctl | |
8 | ||
9 | == NAME | |
10 | ||
11 | zramctl - set up and control zram devices | |
12 | ||
13 | == SYNOPSIS | |
14 | ||
15 | Get info: :: | |
16 | ||
4d297435 | 17 | *zramctl* [options] |
b9d2ddfb MB |
18 | |
19 | Reset zram: :: | |
20 | ||
21 | *zramctl* *-r* _zramdev_... | |
22 | ||
23 | Print name of first unused zram device: :: | |
24 | ||
25 | *zramctl* *-f* | |
26 | ||
27 | Set up a zram device: :: | |
28 | ||
29 | *zramctl* [*-f* | _zramdev_] [*-s* _size_] [*-t* _number_] [*-a* _algorithm_] | |
30 | ||
31 | == DESCRIPTION | |
32 | ||
33 | *zramctl* is used to quickly set up zram device parameters, to reset zram devices, and to query the status of used zram devices. | |
34 | ||
35 | If no option is given, all non-zero size zram devices are shown. | |
36 | ||
37 | Note that _zramdev_ node specified on command line has to already exist. The command *zramctl* creates a new _/dev/zram<N>_ nodes only when *--find* option specified. It's possible (and common) that after system boot _/dev/zram<N>_ nodes are not created yet. | |
38 | ||
39 | == OPTIONS | |
40 | ||
ee16b9ff | 41 | *-a*, **--algorithm lzo**|**lz4**|**lz4hc**|**deflate**|**842**|**zstd**:: |
4eab78d3 | 42 | Set the compression algorithm to be used for compressing data in the zram device. |
2d7549b7 KZ |
43 | + |
44 | The *list of supported algorithms could be inaccurate* as it depends on the current kernel configuration. A basic overview can be obtained by using the command "cat /sys/block/zram0/comp_algorithm"; however, please note that this list might also be incomplete. This is due to the fact that ZRAM utilizes the Crypto API, and if certain algorithms were built as modules, it becomes impossible to enumerate all of them. | |
b9d2ddfb MB |
45 | |
46 | *-f*, *--find*:: | |
4eab78d3 | 47 | Find the first unused zram device. If a *--size* argument is present, then initialize the device. |
b9d2ddfb MB |
48 | |
49 | *-n*, *--noheadings*:: | |
4eab78d3 | 50 | Do not print a header line in status output. |
b9d2ddfb MB |
51 | |
52 | *-o*, *--output* _list_:: | |
4eab78d3 | 53 | Define the status output columns to be used. If no output arrangement is specified, then a default set is used. Use *--help* to get a list of all supported columns. |
b9d2ddfb MB |
54 | |
55 | *--output-all*:: | |
4eab78d3 | 56 | Output all available columns. |
b9d2ddfb MB |
57 | |
58 | *--raw*:: | |
4eab78d3 | 59 | Use the raw format for status output. |
b9d2ddfb MB |
60 | |
61 | *-r*, *--reset*:: | |
4eab78d3 | 62 | Reset the options of the specified zram device(s). Zram device settings can be changed only after a reset. |
b9d2ddfb MB |
63 | |
64 | *-s*, *--size* _size_:: | |
4eab78d3 MB |
65 | Create a zram device of the specified _size_. Zram devices are aligned to memory pages; when the requested _size_ is not a multiple of the page size, it will be rounded up to the next multiple. When not otherwise specified, the unit of the _size_ parameter is bytes. |
66 | + | |
67 | The _size_ argument may be followed by the 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" has the same meaning as "KiB") or the suffixes KB (=1000), MB (=1000*1000), and so on for GB, TB, PB, EB, ZB and YB. | |
b9d2ddfb MB |
68 | |
69 | *-t*, *--streams* _number_:: | |
b9081962 | 70 | Set the maximum number of compression streams that can be used for the device. The default is use all CPUs and one stream for kernels older than 4.6. |
b9d2ddfb | 71 | |
2b2d3172 | 72 | include::man-common/help-version.adoc[] |
b9d2ddfb MB |
73 | |
74 | == EXIT STATUS | |
75 | ||
76 | *zramctl* returns 0 on success, nonzero on failure. | |
77 | ||
78 | == FILES | |
79 | ||
80 | _/dev/zram[0..N]_:: | |
4eab78d3 | 81 | zram block devices |
b9d2ddfb MB |
82 | |
83 | == EXAMPLE | |
84 | ||
85 | The following commands set up a zram device with a size of one gigabyte and use it as swap device. | |
86 | ||
87 | .... | |
88 | # zramctl --find --size 1024M | |
89 | /dev/zram0 | |
90 | # mkswap /dev/zram0 | |
91 | # swapon /dev/zram0 | |
92 | ... | |
93 | # swapoff /dev/zram0 | |
94 | # zramctl --reset /dev/zram0 | |
95 | .... | |
96 | ||
97 | == AUTHORS | |
98 | ||
4eab78d3 | 99 | mailto:nefelim4ag@gmail.com[Timofey Titovets], |
b9d2ddfb MB |
100 | mailto:kzak@redhat.com[Karel Zak] |
101 | ||
102 | == SEE ALSO | |
103 | ||
26c9eb35 | 104 | link:https://docs.kernel.org/admin-guide/blockdev/zram.html[Linux kernel documentation] |
b9d2ddfb | 105 | |
625e9c61 | 106 | include::man-common/bugreports.adoc[] |
b9d2ddfb | 107 | |
625e9c61 | 108 | include::man-common/footer.adoc[] |
b9d2ddfb MB |
109 | |
110 | ifdef::translation[] | |
625e9c61 | 111 | include::man-common/translation.adoc[] |
b9d2ddfb | 112 | endif::[] |