swap(1M) swap(1M)
NAME
swap - swap administrative interface
SYNOPSIS
/usr/sbin/swap -a swapname swaplow swaplen
/usr/sbin/swap -c [filename]
/usr/sbin/swap -d swapname swaplow
/usr/sbin/swap -l [-s]
/usr/sbin/swap -s
DESCRIPTION
swap provides a method of adding, deleting, and monitoring the
system swap areas used by the memory manager.
Options
swap takes the following options:
-a Add the specified swap area. swapname is the name of
the block special partition, for example, /dev/dsk/*,
where the value of * is machine dependent, or a regular
file. swaplow is the offset in 512-byte blocks into the
partition where the swap area should begin. If the
offset value is omitted, an offset of zero is used.
swaplen is the length of the swap area in 512-byte
blocks. The actual area used by the operating system
may be slightly smaller due to file system block-size
rounding. If the size of the swap area is omitted, the
size of the device is used, if available; if not
available, the command will fail, reporting that an
explicit size must be supplied for this device. This
option can only be used by a privileged user.
Swap areas are normally added by modifying the /sbin/rcn
file to include the swap command that is executed when
the system is entering run level n. Generally, this
occurs during system start-up.
-c Configure the swap area by adding all the devices listed
in filename as swap devices. If no filename option is
given, /etc/swaptab is used as the input file.
This option can only be used by a privileged user.
-d Delete the specified swap area. swapname is the name of
block special partition, for example, /dev/dsk/*, where
the value of * is machine dependent, or a regular file.
Copyright 1994 Novell, Inc. Page 1
swap(1M) swap(1M)
swaplow is the offset in 512-byte blocks into the
partition specifying the beginning of the swap area to
be deleted. If swaplow is omitted, an offset of zero is
assumed. While the delete operation is in process, the
swap are is marked as ``INDEL'' (in the process of being
deleted). A concurrently executed swap -l command could
observe the INDEL state and report it at the end of the
line listing the swap area. The system will not
allocate any new blocks from the area, and will try to
free swap blocks from it. The area will remain in use
until all blocks from it are freed. When the swap
command completes, the deletion is also complete.
This option can be used only by a privileged user.
-l List the status of all the swap areas. The output has
five columns:
path The path name for the swap area.
dev The major/minor device number in decimal if
it is a block special device; zeros
otherwise.
swaplo The swaplow value for the area in 512-byte
blocks.
blocks The swaplen value for the area in 512-byte
blocks.
free The number of free 512-byte blocks in the
area. If the swap area is being deleted,
the word INDEL will be printed to the right
of this number.
-s Print the following information about total swap space
usage:
allocated The amount of swap space (in 512-byte
blocks) allocated to private pages.
reserved The amount of swap space (in 512-bytes
blocks) not currently allocated, but claimed
by memory mappings that have not yet created
private pages.
Copyright 1994 Novell, Inc. Page 2
swap(1M) swap(1M)
used The total amount of swap space, in 512-byte
blocks, that is either allocated or
reserved.
available The total swap space, in 512-byte blocks,
that is currently available for future
reservation and allocation.
USAGE
When adding swap space using the swap command, an ordinary
file can be specified as the swap area. In fact, this is
often the only the way the command can be used because it is
rare to have an unused disk partition available. To create
the swap space, you need to create a file as big as the
intended swap space. It is not enough to simply create a
zero-length file; it must be as large as the intended swap
space, or the swap command will fail.
To do this, you can use the dd(1M) command, as shown in the
following example:
dd < /dev/zero > /dev/more_swap bs=512 count=10000
swap -a /dev/more_swap 0 10000
Example
The following swap example requests 10K of swap area (twenty
512-byte blocks) on the device /dev/dsk/*, where the value of
* is machine dependent.
swap -a /dev/dsk/* 0 20
DIAGNOSTICS
The command swap -d will fail if the result of the deletion
would result in insufficient swap space to support the
currently executing workload. In this case the message will
be
SC_REMOVE failed
REFERENCES
dd(1M), swaptab(4)
NOTICES
Privileged use of this command is restricted to maintenance
mode. See the system administration documentation for a
description of maintenance mode.
Copyright 1994 Novell, Inc. Page 3
swap(1M) swap(1M)
No check is done to see if a swap area being added overlaps
with an existing file system.
NFS files are not recommended to be used as swap storage.
Copyright 1994 Novell, Inc. Page 4