swapon.1m (2010 09)

s
swapon(1M) swapon(1M)
-L length When configuring the primary paging device for next boot, length specifies the max-
imum number of blocks that will be used for paging. The default for length is to the
end-of-device.
-L length can only be specified when defining primary swap space
for 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, indi-
cating 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 dev-
ices 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
system, that is reserved for file system use only, making it unavailable to the paging
system. 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 follow-
ing 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 max-
imum 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 sys-
tem 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
HP-UX 11i Version 3: September 2010 3 Hewlett-Packard Company 3