summaryrefslogtreecommitdiffstats
path: root/sys-utils/zramctl.8.adoc
blob: cdfb13d161a06218e6b37b20215ea2fc85237ae7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
//po4a: entry man manual
= zramctl(8)
:doctype: manpage
:man manual: System Administration
:man source: util-linux {release-version}
:page-layout: base
:command: zramctl

== NAME

zramctl - set up and control zram devices

== SYNOPSIS

Get info: ::

*zramctl* [options]

Reset zram: ::

*zramctl* *-r* _zramdev_...

Print name of first unused zram device: ::

*zramctl* *-f*

Set up a zram device: ::

*zramctl* [*-f* | _zramdev_] [*-s* _size_] [*-t* _number_] [*-a* _algorithm_]

== DESCRIPTION

*zramctl* is used to quickly set up zram device parameters, to reset zram devices, and to query the status of used zram devices.

If no option is given, all non-zero size zram devices are shown.

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.

== OPTIONS

*-a*, **--algorithm lzo**|**lz4**|**lz4hc**|**deflate**|**842**|**zstd**::
Set the compression algorithm to be used for compressing data in the zram device.

*-f*, *--find*::
Find the first unused zram device. If a *--size* argument is present, then initialize the device.

*-n*, *--noheadings*::
Do not print a header line in status output.

*-o*, *--output* _list_::
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.

*--output-all*::
Output all available columns.

*--raw*::
Use the raw format for status output.

*-r*, *--reset*::
Reset the options of the specified zram device(s). Zram device settings can be changed only after a reset.

*-s*, *--size* _size_::
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.
+
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.

*-t*, *--streams* _number_::
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.

include::man-common/help-version.adoc[]

== EXIT STATUS

*zramctl* returns 0 on success, nonzero on failure.

== FILES

_/dev/zram[0..N]_::
zram block devices

== EXAMPLE

The following commands set up a zram device with a size of one gigabyte and use it as swap device.

....
 # zramctl --find --size 1024M
 /dev/zram0
 # mkswap /dev/zram0
 # swapon /dev/zram0
 ...
 # swapoff /dev/zram0
 # zramctl --reset /dev/zram0
....

== AUTHORS

mailto:nefelim4ag@gmail.com[Timofey Titovets],
mailto:kzak@redhat.com[Karel Zak]

== SEE ALSO

link:http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/admin-guide/blockdev/zram.rst[Linux kernel documentation]

include::man-common/bugreports.adoc[]

include::man-common/footer.adoc[]

ifdef::translation[]
include::man-common/translation.adoc[]
endif::[]