]> git.ipfire.org Git - thirdparty/util-linux.git/blame - sys-utils/zramctl.8
tests: update lscpu output
[thirdparty/util-linux.git] / sys-utils / zramctl.8
CommitLineData
0624d840
KZ
1.TH ZRAMCTL 8 "July 2014" "util-linux" "System Administration"
2.SH NAME
3zramctl \- set up and control zram devices
4.SH SYNOPSIS
5.ad l
6Get info:
7.sp
8.in +5
9.BR zramctl " [options]"
10.sp
11.in -5
12Reset zram:
13.sp
14.in +5
15.B "zramctl \-r"
16.IR zramdev ...
17.sp
18.in -5
19Print name of first unused zram device:
20.sp
21.in +5
22.B "zramctl \-f"
23.sp
24.in -5
f0b3e6c2 25Set up a zram device:
0624d840
KZ
26.sp
27.in +5
28.B zramctl
29.RB [ \-f " | "\fIzramdev\fP ]
30.RB [ \-s
31.IR size ]
f0b3e6c2 32.RB [ \-t
0624d840 33.IR number ]
0624d840
KZ
34.RB [ \-a
35.IR algorithm ]
36.sp
f0b3e6c2 37.in -5
0624d840
KZ
38.ad b
39.SH DESCRIPTION
40.B zramctl
41is used to quickly set up zram device parameters, to reset zram devices, and to
1253b2a3
KZ
42query the status of used zram devices.
43.PP
44If no option is given, all non-zero size zram devices are shown.
3b3f4374
KZ
45.PP
46Note that \fIzramdev\fP node specified on command line has to already exist. The command
47.B zramctl
48creates a new /dev/zram<N> nodes only when \fB\-\-find\fR option specified. It's possible
49(and common) that after system boot /dev/zram<N> nodes are not created yet.
0624d840 50.SH OPTIONS
f0b3e6c2 51.TP
a3612b81 52.BR \-a , " \-\-algorithm lzo" | lz4 | lz4hc | deflate | 842
f0b3e6c2
BS
53Set the compression algorithm to be used for compressing data in the zram device.
54.TP
55.BR \-f , " \-\-find"
3b3f4374 56Find the first unused zram device. If a \fB\-\-size\fR argument is present, then
0624d840 57initialize the device.
f0b3e6c2
BS
58.TP
59.BR \-n , " \-\-noheadings"
0624d840 60Do not print a header line in status output.
f0b3e6c2
BS
61.TP
62.BR \-o , " \-\-output " \fIlist
63Define the status output columns to be used. If no output arrangement is
64specified, then a default set is used.
0624d840 65Use \fB\-\-help\fP to get a list of all supported columns.
f0b3e6c2 66.TP
2e7ccec7
SK
67.B \-\-output\-all
68Output all available columns.
69.TP
f0b3e6c2 70.B \-\-raw
0624d840 71Use the raw format for status output.
f0b3e6c2
BS
72.TP
73.BR \-r , " \-\-reset"
74Reset the options of the specified zram device(s). Zram device settings
75can be changed only after a reset.
76.TP
77.BR \-s , " \-\-size " \fIsize
882be626
BS
78Create a zram device of the specified \fIsize\fR.
79Zram devices are aligned to memory pages; when the requested \fIsize\fR is
80not a multiple of the page size, it will be rounded up to the next multiple.
81When not otherwise specified, the unit of the \fIsize\fR parameter is bytes.
ef567176 82.IP
0624d840
KZ
83The \fIsize\fR argument may be followed by the multiplicative suffixes KiB (=1024),
84MiB (=1024*1024), and so on for GiB, TiB, PiB, EiB, ZiB and YiB (the "iB"
85is optional, e.g., "K" has the same meaning as "KiB") or the suffixes
86KB (=1000), MB (=1000*1000), and so on for GB, TB, PB, EB, ZB and YB.
f0b3e6c2
BS
87.TP
88.BR \-t , " \-\-streams " \fInumber
89Set the maximum number of compression streams that can be used for the device.
90The default is one stream.
91.TP
92.BR \-V , " \-\-version"
0624d840 93Display version information and exit.
f0b3e6c2
BS
94.TP
95.BR \-h , " \-\-help"
96Display help text and exit.
0624d840
KZ
97
98.SH RETURN VALUE
99.B zramctl
100returns 0 on success, nonzero on failure.
101
102.SH FILES
103.TP
104.I /dev/zram[0..N]
105zram block devices
106
107.SH EXAMPLE
f0b3e6c2
BS
108The following commands set up a zram device with a size of one gigabyte
109and use it as swap device.
0624d840
KZ
110.nf
111.IP
112# zramctl --find --size 1024M
113/dev/zram0
114# mkswap /dev/zram0
115# swapon /dev/zram0
116 ...
117# swapoff /dev/zram0
118# zramctl --reset /dev/zram0
119.fi
b464fd62
SK
120.SH SEE ALSO
121.UR http://git.\:kernel.\:org\:/cgit\:/linux\:/kernel\:/git\:/torvalds\:/linux.git\:/tree\:/Documentation\:/blockdev\:/zram.txt
122Linux kernel documentation
123.UE .
0624d840
KZ
124.SH AUTHORS
125.nf
126Timofey Titovets <nefelim4ag@gmail.com>
127Karel Zak <kzak@redhat.com>
128.fi
129.SH AVAILABILITY
130The zramctl command is part of the util-linux package and is available from
d673b74e 131https://www.kernel.org/pub/linux/utils/util-linux/.