Upload Tizen:Base source
[framework/base/util-linux-ng.git] / mount / swapon.8
1 .\" Copyright (c) 1980, 1991 Regents of the University of California.
2 .\" 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 .\" 3. All advertising materials mentioning features or use of this software
13 .\"    must display the following acknowledgement:
14 .\"     This product includes software developed by the University of
15 .\"     California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\"    may be used to endorse or promote products derived from this software
18 .\"    without specific prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .\"
32 .\"     @(#)swapon.8    6.3 (Berkeley) 3/16/91
33 .\"
34 .\" Sun Dec 27 12:31:30 1992: Modified by faith@cs.unc.edu
35 .\" Sat Mar  6 20:46:02 1993: Modified by faith@cs.unc.edu
36 .\" Sat Oct  9 09:35:30 1993: Converted to man format by faith@cs.unc.edu
37 .\" Sat Nov 27 20:22:42 1993: Updated authorship information, faith@cs.unc.edu
38 .\" Mon Sep 25 14:12:38 1995: Added -v and -p information
39 .\" Tue Apr 30 03:32:07 1996: Added some text from A. Koppenhoefer
40 .\"
41 .TH SWAPON 8 "25 September 1995" "Linux 1.x" "Linux Programmer's Manual"
42 .SH NAME
43 swapon, swapoff \- enable/disable devices and files for paging and swapping
44 .SH SYNOPSIS
45 Get info:
46 .br
47 .in +5
48 .B swapon \-s
49 .RB [ \-h ]
50 .RB [ \-V ]
51 .sp
52 .in -5
53 Enable/disable:
54 .br
55 .in +5
56 .B swapon
57 .RB [ \-f ]
58 .RB [ \-p
59 .IR priority ]
60 .RB [ \-v ]
61 .IR specialfile ...
62 .br
63 .B swapoff
64 .RB [ \-v ]
65 .IR specialfile ...
66 .sp
67 .in -5
68 Enable/disable all:
69 .br
70 .in +5
71 .B swapon \-a
72 .RB [ \-e ]
73 .RB [ \-f ]
74 .RB [ \-v ]
75 .br
76 .B swapoff \-a
77 .RB [ \-v ]
78 .in -5
79 .SH DESCRIPTION
80 .B swapon
81 is used to specify devices on which paging and swapping are to take place.
82
83 The device or file used is given by the
84 .I specialfile
85 parameter. It may be of the form
86 .BI \-L " label"
87 or
88 .BI \-U " uuid"
89 to indicate a device by label or uuid.
90
91 Calls to
92 .B swapon
93 normally occur in the system boot scripts making all swap devices available, so
94 that the paging and swapping activity is interleaved across several devices and
95 files.
96
97 .B swapoff
98 disables swapping on the specified devices and files.
99 When the
100 .B \-a
101 flag is given, swapping is disabled on all known swap devices and files
102 (as found in
103 .I /proc/swaps
104 or
105 .IR /etc/fstab ).
106
107 .TP
108 .B "\-a, \-\-all"
109 All devices marked as ``swap'' in
110 .I /etc/fstab
111 are made available, except for those with the ``noauto'' option.
112 Devices that are already being used as swap are silently skipped.
113 .TP
114 .B "\-e, \-\-ifexists"
115 Silently skip devices that do not exist.
116 .TP
117 .B "\-f, \-\-fixpgsz"
118 Reinitialize (exec /sbin/mkswap) the swap space if its page size does not
119 match that of the the current running kernel.
120 .B mkswap(2)
121 initializes the whole device and does not check for bad blocks.
122 .TP
123 .B \-h, \-\-help
124 Provide help.
125 .TP
126 .B "\-L \fIlabel\fP"
127 Use the partition that has the specified
128 .IR label .
129 (For this, access to
130 .I /proc/partitions
131 is needed.)
132 .TP
133 .B "\-p, \-\-priority \fIpriprity\fP"
134 Specify the priority of the swap device.
135 .I priority
136 is a value between 0 and 32767. Higher numbers indicate higher
137 priority. See
138 .BR swapon (2)
139 for a full description of swap priorities. Add
140 .BI pri= value
141 to the option field of
142 .I /etc/fstab
143 for use with
144 .BR "swapon -a" .
145 .TP
146 .B "\-s, \-\-summary"
147 Display swap usage summary by device. Equivalent to "cat /proc/swaps".
148 Not available before Linux 2.1.25.
149 .TP
150 .B "\-U \fIuuid\fP"
151 Use the partition that has the specified
152 .IR uuid .
153 .TP
154 .B "\-v, \-\-verbose"
155 Be verbose.
156 .TP
157 .B "\-V, \-\-version"
158 Display version.
159 .SH NOTES
160 You should not use
161 .B swapon
162 on a file with holes.
163 Swap over NFS may not work.
164 .PP
165 .B swapon
166 automatically detects and rewrites swap space signature with old software
167 suspend data (e.g S1SUSPEND, S2SUSPEND, ...). The problem is that if we don't
168 do it, then we get data corruption the next time an attempt at unsuspending is
169 made.
170 .SH SEE ALSO
171 .BR swapon (2),
172 .BR swapoff (2),
173 .BR fstab (5),
174 .BR init (8),
175 .BR mkswap (8),
176 .BR rc (8),
177 .BR mount (8)
178 .SH FILES
179 .br
180 .I /dev/sd??
181 standard paging devices
182 .br
183 .I /etc/fstab
184 ascii filesystem description table
185 .SH HISTORY
186 The
187 .B swapon
188 command appeared in 4.0BSD.
189 .SH AVAILABILITY
190 The swapon command is part of the util-linux-ng package and is available from
191 ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.