Blame SOURCES/zram-generator.conf.5

d8d2e6
.\" generated with Ronn-NG/v0.9.1
d8d2e6
.\" http://github.com/apjanke/ronn-ng/tree/0.9.1
d8d2e6
.TH "ZRAM\-GENERATOR\.CONF" "5" "February 2021" "zram-generator developers"
d8d2e6
.SH "NAME"
d8d2e6
\fBzram\-generator\.conf\fR \- Systemd unit generator for zram swap devices (configuration)
d8d2e6
.SH "SYNOPSIS"
d8d2e6
\fB/usr/lib/systemd/zram\-generator\.conf\fR
d8d2e6
.br
d8d2e6
\fB/usr/local/lib/systemd/zram\-generator\.conf\fR
d8d2e6
.br
d8d2e6
\fB/etc/systemd/zram\-generator\.conf\fR
d8d2e6
.br
d8d2e6
\fB/run/systemd/zram\-generator\.conf\fR
d8d2e6
.P
d8d2e6
\fB/usr/lib/systemd/zram\-generator\.conf\.d/*\.conf\fR
d8d2e6
.br
d8d2e6
\fB/usr/local/lib/systemd/zram\-generator\.conf\.d/*\.conf\fR
d8d2e6
.br
d8d2e6
\fB/etc/systemd/zram\-generator\.conf\.d/*\.conf\fR
d8d2e6
.br
d8d2e6
\fB/run/systemd/zram\-generator\.conf\.d/*\.conf\fR
d8d2e6
.SH "DESCRIPTION"
d8d2e6
These files configure devices created by zram\-generator(8)\. See systemd\.syntax(5) for a general description of the syntax\.
d8d2e6
.SH "CONFIGURATION DIRECTORIES AND PRECEDENCE"
d8d2e6
The default configuration doesn\'t specify any devices\. Consult \fI/usr/share/zram\-generator/zram\-generator\.conf\.example\fR for an example configuration file\.
d8d2e6
.P
d8d2e6
When packages need to customize the configuration, they can install configuration snippets in \fI/usr/lib/systemd/zram\-generator\.conf\.d/\fR\. Files in \fI/etc/\fR are reserved for the local administrator, who may use this logic to override the configuration files installed by vendor packages\. The main configuration file is read before any of the configuration directories, and has the lowest precedence; entries in a file in any configuration directory override entries in the single configuration file\. Files in the \fI*\.conf\.d/\fR configuration subdirectories are sorted by their filename in lexicographic order, regardless of which of the subdirectories they reside in\. When multiple files specify the same option, for options which accept just a single value, the entry in the file with the lexicographically latest name takes precedence\. It is recommended to prefix all filenames in those subdirectories with a two\-digit number and a dash, to simplify the ordering of the files\.
d8d2e6
.P
d8d2e6
To disable a configuration file supplied by the vendor, the recommended way is to place a symlink to \fI/dev/null\fR in the configuration directory in \fI/etc/\fR, with the same filename as the vendor configuration file\.
d8d2e6
.P
d8d2e6
The generator understands the following option on the kernel command\-line: \fBsystemd\.zram[=0|1]\fR\. When specified with a true argument (or no argument), the \fBzram0\fR device will be created\. Default options apply, but may be overridden by configuration on disk if present\. When specified with a false argument, no zram devices will be created by the generator\. This option thus has higher priority than the configuration files\.
d8d2e6
.SH "OPTIONS"
d8d2e6
Each device is configured independently in its \fB[zramN]\fR section, where N is a nonnegative integer\. Other sections are ignored\.
d8d2e6
.P
d8d2e6
Devices with the final size of \fI0\fR will be discarded\.
d8d2e6
.IP "\[ci]" 4
d8d2e6
\fBhost\-memory\-limit\fR=
d8d2e6
.IP
d8d2e6
Sets the upper limit on the total usable RAM (as defined by \fIMemTotal\fR in \fB/proc/meminfo\fR, confer proc(5)) above which the device will \fInot\fR be created\.
d8d2e6
.IP
d8d2e6
This takes a nonnegative number, representing that limit in megabytes, or the literal string \fInone\fR, which can be used to override a limit set earlier\.
d8d2e6
.IP
d8d2e6
Defaults to \fInone\fR\.
d8d2e6
.IP
d8d2e6
For compatibility with earlier versions, \fBmemory\-limit\fR is allowed as an alias for this option\. Its use is discouraged, and administrators should migrate to \fBhost\-memory\-limit\fR\.
d8d2e6
.IP "\[ci]" 4
d8d2e6
\fBzram\-fraction\fR=
d8d2e6
.IP
d8d2e6
Defines the scaling factor of the zram device\'s size with relation to the total usable RAM\.
d8d2e6
.IP
d8d2e6
This takes a nonnegative floating\-point number representing that factor\.
d8d2e6
.IP
d8d2e6
Defaults to \fI0\.5\fR\.
d8d2e6
.IP "\[ci]" 4
d8d2e6
\fBmax\-zram\-size\fR=
d8d2e6
.IP
d8d2e6
Sets the limit on the zram device\'s size obtained by \fBzram\-fraction\fR\.
d8d2e6
.IP
d8d2e6
This takes a nonnegative number, representing that limit in megabytes, or the literal string \fInone\fR, which can be used to override a limit set earlier\.
d8d2e6
.IP
d8d2e6
Defaults to \fI4096\fR\.
d8d2e6
.IP "\[ci]" 4
d8d2e6
\fBcompression\-algorithm\fR=
d8d2e6
.IP
d8d2e6
Specifies the algorithm used to compress the zram device\.
d8d2e6
.IP
d8d2e6
This takes a literal string, representing the algorithm to use\.
d8d2e6
.br
d8d2e6
Consult \fI/sys/block/zram0/comp_algorithm\fR for a list of currently loaded compression algorithms, but note that additional ones may be loaded on demand\.
d8d2e6
.IP
d8d2e6
If unset, none will be configured and the kernel\'s default will be used\.
d8d2e6
.IP "\[ci]" 4
d8d2e6
\fBswap\-priority\fR=
d8d2e6
.IP
d8d2e6
Controls the relative swap priority, a value between \-1 and 32767\. Higher numbers indicate higher priority\.
d8d2e6
.IP
d8d2e6
If unset, 100 is used\.
d8d2e6
.IP "\[ci]" 4
d8d2e6
\fBmount\-point\fR=
d8d2e6
.IP
d8d2e6
Format the device with a file system (not as swap) and mount this file system over the specified directory\. When neither this option nor \fBfs\-type\fR= is specified, the device will be formatted as swap\.
d8d2e6
.IP
d8d2e6
Note that the device is temporary: contents will be destroyed automatically after the file system is unmounted (to release the backing memory)\.
d8d2e6
.IP "\[ci]" 4
d8d2e6
\fBfs\-type\fR=
d8d2e6
.IP
d8d2e6
Specifies how the device shall be formatted\. The default is \fIext2\fR if \fBmount\-point\fR is specified, and \fIswap\fR otherwise\. (Effectively, the device will be formatted as swap, if neither \fBfs\-type\fR= nor \fBmount\-point\fR= are specified\.)
d8d2e6
.IP
d8d2e6
Note that the device is temporary: contents will be destroyed automatically after the file system is unmounted (to release the backing memory)\.
d8d2e6
.IP
d8d2e6
Also see systemd\-makefs(8)\.
d8d2e6
.IP "" 0
d8d2e6
.SH "ENVIRONMENT VARIABLES"
d8d2e6
Setting \fBZRAM_GENERATOR_ROOT\fR during parsing will cause \fI/proc/meminfo\fR to be read from \fI$ZRAM_GENERATOR_ROOT/proc/meminfo\fR instead, and \fI{/usr/lib,/usr/local/lib,/etc,/run}/systemd/zram\-generator\.conf\fR to be read from \fI$ZRAM_GENERATOR_ROOT/{/usr/lib,/usr/local/lib,/etc,/run}/systemd/zram\-generator\.conf\fR\.
d8d2e6
.SH "EXAMPLES"
d8d2e6
The default configuration will yield the following:
d8d2e6
.IP "" 4
d8d2e6
.nf
d8d2e6
 zram device size [MB]
d8d2e6
     ^
d8d2e6
d8d2e6
  4G>│               ooooooooooooo
d8d2e6
     │             o
d8d2e6
     │           o
d8d2e6
     │         o
d8d2e6
  2G>│       o
d8d2e6
     │     o
d8d2e6
     │   o
d8d2e6
512M>│ o
d8d2e6
     0───────────────────────> total usable RAM [MB]
d8d2e6
       ^     ^       ^
d8d2e6
       1G    4G      8G
d8d2e6
.fi
d8d2e6
.IP "" 0
d8d2e6
.SH "REPORTING BUGS"
d8d2e6
<\fIhttps://github\.com/systemd/zram\-generator/issues\fR>
d8d2e6
.SH "SEE ALSO"
d8d2e6
zram\-generator(8), systemd\.syntax(5), proc(5)
d8d2e6
.P
d8d2e6
<\fIhttps://github\.com/systemd/zram\-generator\fR>
d8d2e6
.P
d8d2e6
Linux documentation of zram: <\fIhttps://kernel\.org/doc/html/latest/admin\-guide/blockdev/zram\.html\fR>
d8d2e6
.br
d8d2e6
and the zram sysfs ABI: <\fIhttps://kernel\.org/doc/Documentation/ABI/testing/sysfs\-block\-zram\fR>