NetBSD/sbin/swapctl/swapctl.8

196 lines
4.9 KiB
Groff
Raw Normal View History

.\" $NetBSD: swapctl.8,v 1.5 1997/06/25 23:18:10 thorpej Exp $
1997-06-12 17:14:11 +04:00
.\"
.\" Copyright (c) 1997 Matthew R. Green
.\" 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.
.\" 3. All advertising materials mentioning features or use of this software
.\" must display the following acknowledgement:
.\" This product includes software developed by Matthew R. Green.
.\" 4. The name of the author may not be used to endorse or promote products
.\" derived from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
.\"
.Dd June 12, 1997
.Dt SWAPCTL 8
.Os NetBSD
.Sh NAME
.Nm swapctl
.Nd system swap management tool
.Sh SYNOPSIS
.Nm swapctl
1997-06-15 08:08:33 +04:00
.Fl A
1997-06-12 17:14:11 +04:00
.Op Fl p Ar priority
.Op Fl t Ar blk|noblk
1997-06-12 17:14:11 +04:00
.Nm swapctl
1997-06-15 08:08:33 +04:00
.Fl a
1997-06-12 17:14:11 +04:00
.Op Fl p Ar priority
.Ar path
.Nm swapctl
1997-06-15 08:08:33 +04:00
.Fl c
.Fl p Ar priority
.Ar path
.Nm swapctl
.Fl d
.Ar path
.Nm swapctl
.Fl l | Fl s
1997-06-12 17:14:11 +04:00
.Op Fl k
.Nm swapon
1997-06-15 08:08:33 +04:00
.Fl a | Ar path
.Nm swapoff
1997-06-12 17:14:11 +04:00
.Ar path
.Sh DESCRIPTION
The
.Nm
1997-06-15 08:08:33 +04:00
program adds, removes,
1997-06-12 17:14:11 +04:00
lists and prioritizes swap devices and files for the system.
The
.Nm swapon
program acts the same as the
.Nm
program, as if called with the
.Fl a
option, except if
.Nm swapon
itself is called with
.Fl a
in which case,
.Nm swapon
acts as
.Nm
with the
.Fl A
option.
.Sh OPTIONS
The following options are available:
.Bl -tag -width 123456
.It Fl A
This options causes
.Nm
to read the
.Pa /etc/fstab
file for devices and files with a ``sw'' type, and adds all these entries
as swap devices. The optional
.Fl t
flag allows the type of device to add to be specified. An argument of
.Ar blk
causes all block devices in
.Pa /etc/fstab
to be added. An argument of
.Ar noblk
causes all non-block devices in
.Pa /etc/fstab
to be added. This option is useful in early system startup, where swapping
may be needed before all file systems are available, such as during
disk checks of large file systems.
1997-06-12 17:14:11 +04:00
.It Fl a
The
.Fl a
option requires that a
.Ar path
also be in the argument list. The
.Ar path
is added to the kernel's list of swap devices using the
.Xr swapctl 2
system call. When using the
.Nm swapon
form of this command, the
.Fl a
option is treated the same as the
.Fl A
option, for backwards compatibility.
.It Fl c
The
.Fl c
option changes the priority of the listed swap device or file.
1997-06-15 08:08:33 +04:00
.It Fl d
The
.Fl d
option removes the listed
.Ar path
from the kernel's list of swap devices or files.
1997-06-12 17:14:11 +04:00
.It Fl l
The
.Fl l
option lists the current swap devices and files, and their usage statistics.
.It Fl s
The
.Fl s
option displays a single line summary of current swap statistics.
.It Fl p
The
.Fl p
option sets the priority of swap devices or files to the
.Ar priority
argument. This works with the
.\" .Fl d ,
.Fl a ,
.Fl c
and
.Fl l
options.
.It Fl k
The
.Fl k
option uses 1024 byte blocks instead of the default 512 byte.
.El
.Sh SWAP OPTIONS
When parsing the
.Pa /etc/fstab
file for swap devices, the following options are recognised:
.Pp
.Bl -tag -width nfsmntpt=/path -compact
.It priority=N
1997-06-15 19:22:48 +04:00
This option sets the priority of the specified swap device to N. The
highest priority is 0, second priority is 1, etc.
.It nfsmntpt=/path
This option is useful for swapping to NFS files. It specifies
the local mount point to mount an NFS filesystem. Typically, once
this mount has succeeded, the file to be used for swapping on will
be available under this point mount. For example:
.Bd -literal
server:/export/swap/client none swap sw,nfsmntpt=/swap
.Ed
.El
1997-06-12 17:14:11 +04:00
.Sh HISTORY
The
.Nm
program was first made available in
.Nx 1.3 .
The original
.Nm swapon
program, provided for backwards compatibility, appeared in
.Bx 4.0 .
1997-06-12 17:14:11 +04:00
.Sh AUTHOR
The
.Nm
program was written by Matthew R. Green <mrg@eterna.com.au>.
1997-06-15 08:08:33 +04:00
.Sh BUGS
The
.Fl d
option is not currently supported by
.Nx .
1997-06-12 17:14:11 +04:00
.Sh SEE ALSO
.Xr swapctl 2 ,
.Xr fstab 5 ,
.Xr mount_nfs 8 .