1994-05-26 07:35:07 +01:00
|
|
|
.\" Copyright (c) 1980, 1991, 1993
|
|
|
|
.\" The Regents of the University of California. All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\" 4. Neither the name of the University nor the names of its contributors
|
|
|
|
.\" may be used to endorse or promote products derived from this software
|
|
|
|
.\" without specific prior written permission.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
.\" SUCH DAMAGE.
|
|
|
|
.\"
|
|
|
|
.\" @(#)swapon.8 8.1 (Berkeley) 6/5/93
|
1999-08-28 01:22:10 +01:00
|
|
|
.\" $FreeBSD$
|
1994-05-26 07:35:07 +01:00
|
|
|
.\"
|
2008-05-20 13:24:31 +01:00
|
|
|
.Dd April 29, 2008
|
1994-05-26 07:35:07 +01:00
|
|
|
.Dt SWAPON 8
|
2001-07-10 12:04:34 +01:00
|
|
|
.Os
|
1994-05-26 07:35:07 +01:00
|
|
|
.Sh NAME
|
2003-02-25 07:41:33 +00:00
|
|
|
.Nm swapon , swapoff , swapctl
|
2002-12-15 19:17:57 +00:00
|
|
|
.Nd "specify devices for paging and swapping"
|
1994-05-26 07:35:07 +01:00
|
|
|
.Sh SYNOPSIS
|
2005-02-10 09:19:34 +00:00
|
|
|
.Nm swapon Fl a | Ar
|
|
|
|
.Nm swapoff Fl a | Ar
|
2002-12-28 23:39:47 +00:00
|
|
|
.Nm swapctl
|
2008-05-20 13:24:31 +01:00
|
|
|
.Op Fl AghklmsU
|
2003-02-24 23:02:37 +00:00
|
|
|
.Oo
|
|
|
|
.Fl a Ar
|
|
|
|
|
|
|
|
|
.Fl d Ar
|
|
|
|
.Oc
|
1994-05-26 07:35:07 +01:00
|
|
|
.Sh DESCRIPTION
|
2002-07-06 20:35:14 +01:00
|
|
|
The
|
2003-02-24 23:02:37 +00:00
|
|
|
.Nm swapon , swapoff
|
|
|
|
and
|
|
|
|
.Nm swapctl
|
2003-02-28 00:55:18 +00:00
|
|
|
utilities are used to control swap devices in the system.
|
2003-02-24 23:02:37 +00:00
|
|
|
At boot time all swap entries in
|
2002-12-28 23:39:47 +00:00
|
|
|
.Pa /etc/fstab
|
|
|
|
are added automatically when the system goes multi-user.
|
2003-02-24 08:52:06 +00:00
|
|
|
Swap devices use a fixed interleave; the maximum number of devices
|
2003-02-24 23:02:37 +00:00
|
|
|
is specified by the kernel configuration option
|
|
|
|
.Dv NSWAPDEV ,
|
|
|
|
which is typically set to 4.
|
2003-02-24 08:52:06 +00:00
|
|
|
There is no priority mechanism.
|
2002-12-28 23:39:47 +00:00
|
|
|
.Pp
|
|
|
|
The
|
2002-12-15 19:17:57 +00:00
|
|
|
.Nm swapon
|
2003-02-24 23:02:37 +00:00
|
|
|
utility adds the specified swap devices to the system.
|
|
|
|
If the
|
2002-12-28 23:39:47 +00:00
|
|
|
.Fl a
|
|
|
|
option is used, all swap devices in
|
|
|
|
.Pa /etc/fstab
|
2003-02-24 23:02:37 +00:00
|
|
|
will be added, unless their
|
|
|
|
.Dq noauto
|
|
|
|
option is also set.
|
1994-05-26 07:35:07 +01:00
|
|
|
.Pp
|
2002-12-15 19:17:57 +00:00
|
|
|
The
|
|
|
|
.Nm swapoff
|
2003-02-24 23:02:37 +00:00
|
|
|
utility removes the specified swap devices from the system.
|
|
|
|
If the
|
2002-12-28 23:39:47 +00:00
|
|
|
.Fl a
|
|
|
|
option is used, all swap devices in
|
|
|
|
.Pa /etc/fstab
|
2003-02-24 23:02:37 +00:00
|
|
|
will be removed, unless their
|
|
|
|
.Dq noauto
|
|
|
|
option is also set.
|
2002-12-28 23:39:47 +00:00
|
|
|
Note that
|
2002-12-15 19:17:57 +00:00
|
|
|
.Nm swapoff
|
2002-12-28 23:39:47 +00:00
|
|
|
will fail and refuse to remove a swap device if there is insufficient
|
|
|
|
VM (memory + remaining swap devices) to run the system.
|
2003-02-24 23:02:37 +00:00
|
|
|
The
|
|
|
|
.Nm swapoff
|
|
|
|
utility
|
2002-12-28 23:39:47 +00:00
|
|
|
must move swapped pages out of the device being removed which could
|
|
|
|
lead to high system loads for a period of time, depending on how
|
|
|
|
much data has been swapped out to that device.
|
2002-12-15 19:17:57 +00:00
|
|
|
.Pp
|
2002-12-28 23:39:47 +00:00
|
|
|
The
|
|
|
|
.Nm swapctl
|
2003-02-24 23:02:37 +00:00
|
|
|
utility exists primarily for those familiar with other
|
|
|
|
.Bx Ns s
|
|
|
|
and may be
|
2003-02-25 07:41:33 +00:00
|
|
|
used to add, remove, or list swap devices.
|
2003-02-24 23:02:37 +00:00
|
|
|
Note that the
|
2002-12-28 23:39:47 +00:00
|
|
|
.Fl a
|
2003-02-25 07:41:33 +00:00
|
|
|
option is used differently in
|
2002-12-28 23:39:47 +00:00
|
|
|
.Nm swapctl
|
|
|
|
and indicates that a specific list of devices should be added.
|
2003-02-24 23:02:37 +00:00
|
|
|
The
|
2002-12-28 23:39:47 +00:00
|
|
|
.Fl d
|
2003-02-24 23:02:37 +00:00
|
|
|
option indicates that a specific list should be removed.
|
|
|
|
The
|
2002-12-28 23:39:47 +00:00
|
|
|
.Fl A
|
2003-02-24 23:02:37 +00:00
|
|
|
and
|
|
|
|
.Fl U
|
2002-12-28 23:39:47 +00:00
|
|
|
options to
|
|
|
|
.Nm swapctl
|
|
|
|
operate on all swap entries in
|
1994-05-26 07:35:07 +01:00
|
|
|
.Pa /etc/fstab
|
2003-02-24 23:02:37 +00:00
|
|
|
which do not have their
|
|
|
|
.Dq noauto
|
|
|
|
option set.
|
1994-05-26 07:35:07 +01:00
|
|
|
.Pp
|
2002-12-28 23:39:47 +00:00
|
|
|
Swap information can be generated using the
|
2003-02-24 23:02:37 +00:00
|
|
|
.Xr swapinfo 8
|
|
|
|
utility,
|
2002-12-28 23:39:47 +00:00
|
|
|
.Nm pstat
|
|
|
|
.Fl s ,
|
|
|
|
or
|
|
|
|
.Nm swapctl
|
2003-02-25 07:41:33 +00:00
|
|
|
.Fl l .
|
2002-12-28 23:39:47 +00:00
|
|
|
The
|
|
|
|
.Nm swapctl
|
|
|
|
utility has the following options for listing swap:
|
|
|
|
.Bl -tag -width indent
|
|
|
|
.It Fl h
|
2008-05-20 13:24:31 +01:00
|
|
|
Output values in human-readable form.
|
|
|
|
.It Fl g
|
|
|
|
Output values in gigabytes.
|
2002-12-28 23:39:47 +00:00
|
|
|
.It Fl k
|
|
|
|
Output values in kilobytes.
|
2008-05-20 13:24:31 +01:00
|
|
|
.It Fl m
|
|
|
|
Output values in megabytes.
|
2003-02-24 23:02:37 +00:00
|
|
|
.It Fl l
|
|
|
|
List the devices making up system swap.
|
|
|
|
.It Fl s
|
|
|
|
Print a summary line for system swap.
|
2002-12-28 23:39:47 +00:00
|
|
|
.Pp
|
2003-02-24 23:02:37 +00:00
|
|
|
The
|
|
|
|
.Ev BLOCKSIZE
|
|
|
|
environment variable is used if not specifically
|
|
|
|
overridden.
|
|
|
|
512 byte blocks are used by default.
|
2002-12-28 23:39:47 +00:00
|
|
|
.El
|
1994-05-26 07:35:07 +01:00
|
|
|
.Sh FILES
|
2003-02-24 23:02:37 +00:00
|
|
|
.Bl -tag -width ".Pa /dev/{ad,da}?s?b" -compact
|
2001-04-10 17:29:41 +01:00
|
|
|
.It Pa /dev/{ad,da}?s?b
|
1994-05-26 07:35:07 +01:00
|
|
|
standard paging devices
|
2001-04-10 17:29:41 +01:00
|
|
|
.It Pa /dev/md?
|
|
|
|
memory disk devices
|
1994-05-26 07:35:07 +01:00
|
|
|
.It Pa /etc/fstab
|
2003-02-24 23:02:37 +00:00
|
|
|
.Tn ASCII
|
|
|
|
file system description table
|
1994-05-26 07:35:07 +01:00
|
|
|
.El
|
2005-01-18 10:09:38 +00:00
|
|
|
.Sh DIAGNOSTICS
|
|
|
|
These utilities may fail for the reasons described in
|
|
|
|
.Xr swapon 2 .
|
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr swapon 2 ,
|
|
|
|
.Xr fstab 5 ,
|
|
|
|
.Xr init 8 ,
|
|
|
|
.Xr mdconfig 8 ,
|
|
|
|
.Xr pstat 8 ,
|
|
|
|
.Xr rc 8
|
1994-05-26 07:35:07 +01:00
|
|
|
.Sh HISTORY
|
|
|
|
The
|
2002-12-15 19:17:57 +00:00
|
|
|
.Nm swapon
|
2002-07-06 20:35:14 +01:00
|
|
|
utility appeared in
|
1994-05-26 07:35:07 +01:00
|
|
|
.Bx 4.0 .
|
2002-12-15 19:17:57 +00:00
|
|
|
The
|
|
|
|
.Nm swapoff
|
2003-02-25 07:41:33 +00:00
|
|
|
and
|
|
|
|
.Nm swapctl
|
|
|
|
utilities appeared in
|
2003-02-24 08:52:06 +00:00
|
|
|
.Fx 5.1 .
|