swapon

From RaySoft

swapon is used to specify devices on which paging and swapping are to take place.[1]

Documentation

Syntax

swapon [PARAMETER ...] [DEVICE]

Parameters

-a, --all
All devices marked as swap devices in /etc/fstab are made available, except for those with the noauto option. Devices that are already running as swap are silently skipped.
-L LABEL
Use the partition that has the specified LABEL. (For this, access to /proc/partitions is needed.)
-p PRIORITY, --priority PRIORITY
Specify PRIORITY for swapon. This option is only available if swapon was compiled under and is used under a 1.3.2 or later kernel. Priority is a value between 0 and 32767. Higher numbers indicate higher priority. [...] Add pri=value to the option field of /etc/fstab for use with swapon -a.
-s, --summary
Display swap usage summary by device.

Examples

Activate a SWAP partition on /dev/hda3
swapon '/dev/hda3'
Show usage of all SWAP partitions
swapon -s

Output:

Filename                                Type            Size    Used    Priority
/dev/sda2                               partition       1048568 0       -1

References

  1. man 8 'swapon'