swapon.1m (2010 09)
s
swapon(1M) swapon(1M)
In either Form 2 or Form 3, an attempt to enable paging to a device will fail and a warning message will
be issued if swapon determines that the device is being used by the
savecrash command to retrieve
system dump information (see savecrash (1M)). The
-u
option can be used to forcibly enable paging to
devices being used by the
savecrash command; however, this may overwrite system dump information
contained on the device.
In Form 4, the
-R
option unconfigures the block device that was previously defined as the primary pag-
ing area for subsequent boots (see
-s
option).
The last two forms of
swapon provide methods for enabling file systems for paging. Form 5 is the pre-
ferred method. Form 6 is obsolescent and provided only for backward compatibility. The directory name
in these forms specifies a directory on the file system that is to be enabled for paging. A directory named
/paging is created at the root of the specified file system (unless the file system’s name ends with
/pag-
ing). All paging files are created within this directory. The optional arguments to the sixth form have
the same meaning as the arguments to the options in Form 5. Note that, in Form 6, if any of the optional
arguments are specified, all must be specified. In Form 5, if more than one directory is given, any options
specified will be applied to all directories.
After a file system has been enabled for paging, the optional arguments can be modified by subsequent
swapon commands.
Options
swapon recognizes the following options and arguments:
-a Cause all devices marked as swap and all file systems marked as swapfs in the
file
/etc/fstab to be made available to the paging system. The options field in
/etc/fstab entries is read by swapon, and must contain elements formatted as
follows:
min=min See the -m option for the value of min.
lim=limit See the -l option for the value of limit . (File system paging areas
only.)
res=reserve See the -r option for the value of reserve . (File system paging
areas only.)
pri=priority See the -p option for the value of priority . (File system paging
areas only.)
end See the -e option for the meaning of this option. (Device paging
areas only.)
See fstab (4) for an example entry.
-e Use space after the end of the file system on the block device for paging. An error
message is returned if no file system is found on the device. This option cannot be
used with the -f option. Do not confuse this with paging to a file system. This
option is for use with a disk that has both a file system and dedicated paging space
on it.
-f Force the device to be enabled, which will destroy the file system on it. Use with
extreme caution. Normally, if a file system exists on the device to be enabled,
swapon fails and displays an error message. This option cannot be used with the
-e option.
-l limit limit specifies the maximum space the paging system is allowed to take from the
disk, provided space is available that is not reserved for exclusive use by the file
system. The value of limit is rounded up so that it is a multiple of the paging allo-
cation chunk size, which is set with the kernel tunable parameter swchunk (see
swchunk(5), kctune (1M), and swapinfo (1M)). See WARNINGS . The default value
for limit is 0, indicating there is no limit to the amount of file system space the pag-
ing system can use.
limit can be specified in decimal (no prefix), octal (
0 prefix), or hexadecimal (0x
prefix). It may be specified in units of kilobytes (k suffix), megabytes (M suffix), or
file system blocks (no suffix). (A kilobyte is 1024 bytes; a megabyte is 1024 kilo-
bytes; the size of a file system block is determined by the administrator when the
file system is created.)
2 Hewlett-Packard Company − 2 − HP-UX 11i Version 3: September 2010