]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - sbin/swapon/swapon.8
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / sbin / swapon / swapon.8
1 .\" Copyright (c) 1980, 1991, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 4. Neither the name of the University nor the names of its contributors
13 .\"    may be used to endorse or promote products derived from this software
14 .\"    without specific prior written permission.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .\" SUCH DAMAGE.
27 .\"
28 .\"     @(#)swapon.8    8.1 (Berkeley) 6/5/93
29 .\" $FreeBSD$
30 .\"
31 .Dd June 23, 2008
32 .Dt SWAPON 8
33 .Os
34 .Sh NAME
35 .Nm swapon , swapoff , swapctl
36 .Nd "specify devices for paging and swapping"
37 .Sh SYNOPSIS
38 .Nm swapon
39 .Oo Fl F Ar fstab
40 .Oc
41 .Fl aq | Ar
42 .Nm swapoff
43 .Oo Fl F Ar fstab
44 .Oc
45 .Fl aq | Ar
46 .Nm swapctl
47 .Op Fl AghklmsU
48 .Oo
49 .Fl a Ar
50 |
51 .Fl d Ar
52 .Oc
53 .Sh DESCRIPTION
54 The
55 .Nm swapon , swapoff
56 and
57 .Nm swapctl
58 utilities are used to control swap devices in the system.
59 At boot time all swap entries in
60 .Pa /etc/fstab
61 are added automatically when the system goes multi-user.
62 Swap devices use a fixed interleave; the maximum number of devices
63 is specified by the kernel configuration option
64 .Dv NSWAPDEV ,
65 which is typically set to 4.
66 There is no priority mechanism.
67 .Pp
68 The
69 .Nm swapon
70 utility adds the specified swap devices to the system.
71 If the
72 .Fl a
73 option is used, all swap devices in
74 .Pa /etc/fstab
75 will be added, unless their
76 .Dq noauto
77 option is also set.
78 If the
79 .Fl q
80 option is used informational messages will not be
81 written to standard output when a swap device is added.
82 .Pp
83 The
84 .Nm swapoff
85 utility removes the specified swap devices from the system.
86 If the
87 .Fl a
88 option is used, all swap devices in
89 .Pa /etc/fstab
90 will be removed, unless their
91 .Dq noauto
92 option is also set.
93 If the
94 .Fl q
95 option is used informational messages will not be
96 written to standard output when a swap device is removed.
97 Note that
98 .Nm swapoff
99 will fail and refuse to remove a swap device if there is insufficient
100 VM (memory + remaining swap devices) to run the system.
101 The
102 .Nm swapoff
103 utility
104 must move swapped pages out of the device being removed which could
105 lead to high system loads for a period of time, depending on how
106 much data has been swapped out to that device.
107 .Pp
108 Other options supported by both
109 .Nm swapon
110 and
111 .Nm swapoff
112 are as follows:
113 .Bl -tag -width indent
114 .It Fl F Ar fstab
115 Specify the
116 .Pa fstab
117 file to use.
118 .El
119 .Pp
120 The
121 .Nm swapctl
122 utility exists primarily for those familiar with other
123 .Bx Ns s
124 and may be
125 used to add, remove, or list swap devices.
126 Note that the
127 .Fl a
128 option is used differently in
129 .Nm swapctl
130 and indicates that a specific list of devices should be added.
131 The
132 .Fl d
133 option indicates that a specific list should be removed.
134 The
135 .Fl A
136 and
137 .Fl U
138 options to
139 .Nm swapctl
140 operate on all swap entries in
141 .Pa /etc/fstab
142 which do not have their
143 .Dq noauto
144 option set.
145 .Pp
146 Swap information can be generated using the
147 .Xr swapinfo 8
148 utility,
149 .Nm pstat
150 .Fl s ,
151 or
152 .Nm swapctl
153 .Fl l .
154 The
155 .Nm swapctl
156 utility has the following options for listing swap:
157 .Bl -tag -width indent
158 .It Fl h
159 Output values in human-readable form.
160 .It Fl g
161 Output values in gigabytes.
162 .It Fl k
163 Output values in kilobytes.
164 .It Fl m
165 Output values in megabytes.
166 .It Fl l
167 List the devices making up system swap.
168 .It Fl s
169 Print a summary line for system swap.
170 .Pp
171 The
172 .Ev BLOCKSIZE
173 environment variable is used if not specifically
174 overridden.
175 512 byte blocks are used by default.
176 .El
177 .Sh FILES
178 .Bl -tag -width ".Pa /dev/{ad,da}?s?b" -compact
179 .It Pa /dev/{ad,da}?s?b
180 standard paging devices
181 .It Pa /dev/md?
182 memory disk devices
183 .It Pa /etc/fstab
184 .Tn ASCII
185 file system description table
186 .El
187 .Sh DIAGNOSTICS
188 These utilities may fail for the reasons described in
189 .Xr swapon 2 .
190 .Sh SEE ALSO
191 .Xr swapon 2 ,
192 .Xr fstab 5 ,
193 .Xr init 8 ,
194 .Xr mdconfig 8 ,
195 .Xr pstat 8 ,
196 .Xr rc 8
197 .Sh HISTORY
198 The
199 .Nm swapon
200 utility appeared in
201 .Bx 4.0 .
202 The
203 .Nm swapoff
204 and
205 .Nm swapctl
206 utilities appeared in
207 .Fx 5.1 .