HP-UX Reference (11i v3 07/02) - 1M System Administration Commands N-Z (vol 4)
s
swapon(1M) swapon(1M)
subsequent boots; therefore, -L must be used in conjunction with the
-s option.
-m min min indicates the space the paging system will initially take from the file system. The
value of min is rounded up so that it is a multiple of the paging allocation chunk size,
which is set with the kernel tunable parameter
swchunk (see swchunk(5),
kctune(1M), and swapinfo(1M)). The default value for min is 0, indicating no paging
space is to be allocated initially. min can be specified in the same forms as limit,
above.
-p priority priority indicates the order in which space is taken from the file systems and devices
used for paging. Space is taken from the systems with lower priority numbers first.
Under most circumstances, space is taken from device paging areas before file system
paging areas, regardless of priority. See "Paging Allocation" in swapinfo(1M) for more
information. priority can have a value from 0 to 10 and has a default value of 1.
-r reserve reserve specifies the space, in addition to the space currently occupied by the file sys-
tem, that is reserved for file system use only, making it unavailable to the paging sys-
tem. This reserved space is in addition to the minimum free space specified by the
administrator when the file system was created. See WARNINGS. The default value
for reserve is 0 indicating that no file system space is reserved for file system use only.
reserve can be specified in the same forms as limit, above.
-R Unconfigure the primary paging device that was previously set (with the -s
option) as
the primary paging area for subsequent boots.
-s Configure the primary paging device for the next and subsequent boots. See also the
-L and -S options.
-S start When configuring the primary paging device for subsequent boots, start specifies the
block address on the device where the paging area will begin. The default value for
start is 0 indicating that the device is dedicated to paging. A starting block can only
be specified when defining primary swap space for subsequent boots; therefore,
-S
must be used in conjunction with the -s option.
-t type Restrict the type of the paging area. If the -t option is omitted, all of the paging
areas defined in /etc/fstab are made available. type can have one of the following
values:
dev Device paging areas.
fs File system paging areas.
local Paging areas defined on the local system.
remote Paging areas defined on remote systems.
-u Unlock block device files which are being used by the savecrash command. Nor-
mally,
swapon will not enable paging on a device if it is being used by savecrash
command to retrieve system dump information. The list of devices in use is main-
tained in the file
/var/adm/crash/.savecrash.LCK
. This option forces the
device to be enabled, which may overwrite any system dump information contained on
the device. This option should be used with extreme caution.
RETURN VALUE
swapon returns one of the following values:
0 Successful completion.
>0 An error condition occurred.
EXAMPLES
The first two examples enable paging to the file system containing the /paging directory. The maximum
number of file system blocks available to the paging system is set to 5000, the number of file system blocks
reserved for file system use only is set to 10000, and the priority is set to 2. The number of file system
blocks initially taken by the paging system defaults to 0 in the first example, and is set to 0 in the second
example. On a file system with the default 8kB block size, these examples allocate approximately 40MB of
file system paging.
/usr/sbin/swapon -l 5000 -r 10000 -p 2 /paging
/usr/sbin/swapon /paging 0 5000 10000 2
438 Hewlett-Packard Company − 3 − HP-UX 11i Version 3: February 2007