1 <?xml version='1.0'?> <!--*-nxml-*-->
2 <?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?>
3 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
4 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
7 This file is part of systemd.
9 Copyright 2010 Lennart Poettering
11 systemd is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 2 of the License, or
14 (at your option) any later version.
16 systemd is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with systemd; If not, see <http://www.gnu.org/licenses/>.
25 <refentry id="systemd.swap">
27 <title>systemd.swap</title>
28 <productname>systemd</productname>
32 <contrib>Developer</contrib>
33 <firstname>Lennart</firstname>
34 <surname>Poettering</surname>
35 <email>lennart@poettering.net</email>
41 <refentrytitle>systemd.swap</refentrytitle>
42 <manvolnum>5</manvolnum>
46 <refname>systemd.swap</refname>
47 <refpurpose>systemd swap configuration files</refpurpose>
51 <para><filename>systemd.swap</filename></para>
55 <title>Description</title>
57 <para>A unit configuration file whose name ends in
58 <filename>.swap</filename> encodes information about a
59 swap device or file for memory paging controlled and
60 supervised by systemd.</para>
62 <para>This man page lists the configuration options
63 specific to this unit type. See
64 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
65 for the common options of all unit configuration
66 files. The common configuration items are configured
67 in the generic [Unit] and [Install] sections. The swap
68 specific configuration options are configured in the
69 [Swap] section.</para>
71 <para>Swap units must be named after the devices they
72 control. Example: the swap device
73 <filename>/dev/sda5</filename> must be configured in a
74 unit file <filename>dev-sda5.swap</filename>. For
75 details about the escaping logic used to convert a
76 file system path to a unit name see
77 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
81 <title><filename>fstab</filename></title>
83 <para>Swap units may either be configured via unit
84 files, or via <filename>/etc/fstab</filename> (see
85 <citerefentry><refentrytitle>fstab</refentrytitle><manvolnum>5</manvolnum></citerefentry>
88 <para>If a swap device or file is configured in both
89 <filename>/etc/fstab</filename> and a unit file the
90 configuration in the latter takes precedence.</para>
94 <title>Options</title>
96 <para>Swap files must include a [Swap] section, which
97 carries information about the swap device it
98 supervises. The options specific to the [Swap] section
99 of swap units are the following:</para>
104 <term><varname>What=</varname></term>
105 <listitem><para>Takes an absolute path
106 of a device node or file to use for
108 <citerefentry><refentrytitle>swapon</refentrytitle><manvolnum>8</manvolnum></citerefentry>
109 for details. If this refers to a
110 device node, a dependency on the
111 respective device unit is
112 automatically created. (See
113 <citerefentry><refentrytitle>systemd.device</refentrytitle><manvolnum>5</manvolnum></citerefentry>
114 for more information.) If this refers
115 to a file, a dependency on the
116 respective mount unit is automatically
118 <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>
119 for more information.) This option is
120 mandatory.</para></listitem>
124 <term><varname>Priority=</varname></term>
126 <listitem><para>Swap priority to use
127 when activating the swap device or
128 file. This takes an integer. This
129 setting is optional.</para></listitem>
135 <title>See Also</title>
137 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
138 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
139 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
140 <citerefentry><refentrytitle>systemd.device</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
141 <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
142 <citerefentry><refentrytitle>swapon</refentrytitle><manvolnum>8</manvolnum></citerefentry>