summaryrefslogtreecommitdiffstats
path: root/sys-utils/zramctl.8
blob: c6ecdc3d5aad255da7e37997f1086e3902960cb4 (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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
.TH ZRAMCTL 8 "July 2014" "util-linux" "System Administration"
.SH NAME
zramctl \- set up and control zram devices
.SH SYNOPSIS
.ad l
Get info:
.sp
.in +5
.BR zramctl " [options]"
.sp
.in -5
Reset zram:
.sp
.in +5
.B "zramctl \-r"
.IR zramdev ...
.sp
.in -5
Print name of first unused zram device:
.sp
.in +5
.B "zramctl \-f"
.sp
.in -5
Set up a zram device:
.sp
.in +5
.B zramctl
.RB [ \-f " | "\fIzramdev\fP ]
.RB [ \-s
.IR size ]
.RB [ \-t
.IR number ]
.RB [ \-a
.IR algorithm ]
.sp
.in -5
.ad b
.SH DESCRIPTION
.B zramctl
is used to quickly set up zram device parameters, to reset zram devices, and to
query the status of used zram devices.
.PP
If no option is given, all non-zero size zram devices are shown.
.PP
Note that \fIzramdev\fP node specified on command line has to already exist. The command
.B zramctl
creates a new /dev/zram<N> nodes only when \fB\-\-find\fR option specified. It's possible
(and common) that after system boot /dev/zram<N> nodes are not created yet.
.SH OPTIONS
.TP
.BR \-a , " \-\-algorithm lzo" | lz4 | lz4hc | deflate | 842
Set the compression algorithm to be used for compressing data in the zram device.
.TP
.BR \-f , " \-\-find"
Find the first unused zram device.  If a \fB\-\-size\fR argument is present, then
initialize the device.
.TP
.BR \-n , " \-\-noheadings"
Do not print a header line in status output.
.TP
.BR \-o , " \-\-output " \fIlist
Define the status output columns to be used.  If no output arrangement is
specified, then a default set is used.
Use \fB\-\-help\fP to get a list of all supported columns.
.TP
.B \-\-output\-all
Output all available columns.
.TP
.B \-\-raw
Use the raw format for status output.
.TP
.BR \-r , " \-\-reset"
Reset the options of the specified zram device(s).  Zram device settings
can be changed only after a reset.
.TP
.BR \-s , " \-\-size " \fIsize
Create a zram device of the specified \fIsize\fR.
Zram devices are aligned to memory pages; when the requested \fIsize\fR 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 \fIsize\fR parameter is bytes.
.IP
The \fIsize\fR 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.
.TP
.BR \-t , " \-\-streams " \fInumber
Set the maximum number of compression streams that can be used for the device.
The default is one stream.
.TP
.BR \-V , " \-\-version"
Display version information and exit.
.TP
.BR \-h , " \-\-help"
Display help text and exit.

.SH RETURN VALUE
.B zramctl
returns 0 on success, nonzero on failure.

.SH FILES
.TP
.I /dev/zram[0..N]
zram block devices

.SH EXAMPLE
The following commands set up a zram device with a size of one gigabyte
and use it as swap device.
.nf
.IP
# zramctl --find --size 1024M
/dev/zram0
# mkswap /dev/zram0
# swapon /dev/zram0
 ...
# swapoff /dev/zram0
# zramctl --reset /dev/zram0
.fi
.SH SEE ALSO
.UR http://git.\:kernel.\:org\:/cgit\:/linux\:/kernel\:/git\:/torvalds\:/linux.git\:/tree\:/Documentation\:/blockdev\:/zram.txt
Linux kernel documentation
.UE .
.SH AUTHORS
.nf
Timofey Titovets <nefelim4ag@gmail.com>
Karel Zak <kzak@redhat.com>
.fi
.SH AVAILABILITY
The zramctl command is part of the util-linux package and is available from
https://www.kernel.org/pub/linux/utils/util-linux/.