]> CyberLeo.Net >> Repos - FreeBSD/releng/7.2.git/blob - sbin/swapon/swapon.8
Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.
[FreeBSD/releng/7.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 December 28, 2002
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 Fl a | Ar
39 .Nm swapoff Fl a | Ar
40 .Nm swapctl
41 .Op Fl AhklsU
42 .Oo
43 .Fl a Ar
44 |
45 .Fl d Ar
46 .Oc
47 .Sh DESCRIPTION
48 The
49 .Nm swapon , swapoff
50 and
51 .Nm swapctl
52 utilities are used to control swap devices in the system.
53 At boot time all swap entries in
54 .Pa /etc/fstab
55 are added automatically when the system goes multi-user.
56 Swap devices use a fixed interleave; the maximum number of devices
57 is specified by the kernel configuration option
58 .Dv NSWAPDEV ,
59 which is typically set to 4.
60 There is no priority mechanism.
61 .Pp
62 The
63 .Nm swapon
64 utility adds the specified swap devices to the system.
65 If the
66 .Fl a
67 option is used, all swap devices in
68 .Pa /etc/fstab
69 will be added, unless their
70 .Dq noauto
71 option is also set.
72 .Pp
73 The
74 .Nm swapoff
75 utility removes the specified swap devices from the system.
76 If the
77 .Fl a
78 option is used, all swap devices in
79 .Pa /etc/fstab
80 will be removed, unless their
81 .Dq noauto
82 option is also set.
83 Note that
84 .Nm swapoff
85 will fail and refuse to remove a swap device if there is insufficient
86 VM (memory + remaining swap devices) to run the system.
87 The
88 .Nm swapoff
89 utility
90 must move swapped pages out of the device being removed which could
91 lead to high system loads for a period of time, depending on how
92 much data has been swapped out to that device.
93 .Pp
94 The
95 .Nm swapctl
96 utility exists primarily for those familiar with other
97 .Bx Ns s
98 and may be
99 used to add, remove, or list swap devices.
100 Note that the
101 .Fl a
102 option is used differently in
103 .Nm swapctl
104 and indicates that a specific list of devices should be added.
105 The
106 .Fl d
107 option indicates that a specific list should be removed.
108 The
109 .Fl A
110 and
111 .Fl U
112 options to
113 .Nm swapctl
114 operate on all swap entries in
115 .Pa /etc/fstab
116 which do not have their
117 .Dq noauto
118 option set.
119 .Pp
120 Swap information can be generated using the
121 .Xr swapinfo 8
122 utility,
123 .Nm pstat
124 .Fl s ,
125 or
126 .Nm swapctl
127 .Fl l .
128 The
129 .Nm swapctl
130 utility has the following options for listing swap:
131 .Bl -tag -width indent
132 .It Fl h
133 Output values in megabytes.
134 .It Fl k
135 Output values in kilobytes.
136 .It Fl l
137 List the devices making up system swap.
138 .It Fl s
139 Print a summary line for system swap.
140 .Pp
141 The
142 .Ev BLOCKSIZE
143 environment variable is used if not specifically
144 overridden.
145 512 byte blocks are used by default.
146 .El
147 .Sh FILES
148 .Bl -tag -width ".Pa /dev/{ad,da}?s?b" -compact
149 .It Pa /dev/{ad,da}?s?b
150 standard paging devices
151 .It Pa /dev/md?
152 memory disk devices
153 .It Pa /etc/fstab
154 .Tn ASCII
155 file system description table
156 .El
157 .Sh DIAGNOSTICS
158 These utilities may fail for the reasons described in
159 .Xr swapon 2 .
160 .Sh SEE ALSO
161 .Xr swapon 2 ,
162 .Xr fstab 5 ,
163 .Xr init 8 ,
164 .Xr mdconfig 8 ,
165 .Xr pstat 8 ,
166 .Xr rc 8
167 .Sh HISTORY
168 The
169 .Nm swapon
170 utility appeared in
171 .Bx 4.0 .
172 The
173 .Nm swapoff
174 and
175 .Nm swapctl
176 utilities appeared in
177 .Fx 5.1 .