1SWAPON(8)                  Linux Programmer's Manual                 SWAPON(8)
2
3
4

NAME

6       swapon, swapoff - enable/disable devices and files for paging and swap‐
7       ping
8

SYNOPSIS

10       Get info:
11            swapon -s [-h] [-V]
12
13       Enable/disable:
14            swapon [-f] [-p priority] [-v] specialfile...
15            swapoff [-v] specialfile...
16
17       Enable/disable all:
18            swapon -a [-e] [-f] [-v]
19            swapoff -a [-v]
20

DESCRIPTION

22       swapon is used to specify devices on which paging and swapping  are  to
23       take place.
24
25       The  device  or file used is given by the specialfile parameter. It may
26       be of the form -L label or -U uuid to indicate a  device  by  label  or
27       uuid.
28
29       Calls  to  swapon  normally occur in the system boot scripts making all
30       swap devices available, so that the paging  and  swapping  activity  is
31       interleaved across several devices and files.
32
33       swapoff disables swapping on the specified devices and files.  When the
34       -a flag is given, swapping is disabled on all known  swap  devices  and
35       files (as found in /proc/swaps or /etc/fstab).
36
37
38       -a, --all
39              All devices marked as ``swap'' in /etc/fstab are made available,
40              except for those with the ``noauto'' option.  Devices  that  are
41              already being used as swap are silently skipped.
42
43       -e, --ifexists
44              Silently skip devices that do not exist.
45
46       -f, --fixpgsz
47              Reinitialize (exec /sbin/mkswap) the swap space if its page size
48              does  not  match  that  of  the  the  current  running   kernel.
49              mkswap(2)  initializes  the  whole device and does not check for
50              bad blocks.
51
52       -h, --help
53              Provide help.
54
55       -L label
56              Use the partition that has  the  specified  label.   (For  this,
57              access to /proc/partitions is needed.)
58
59       -p, --priority priority
60              Specify  the  priority  of the swap device.  priority is a value
61              between 0 and 32767. Higher numbers  indicate  higher  priority.
62              See  swapon(2)  for  a  full description of swap priorities. Add
63              pri=value to the option field of /etc/fstab for use with  swapon
64              -a.
65
66       -s, --summary
67              Display  swap  usage  summary  by  device.  Equivalent  to  "cat
68              /proc/swaps".  Not available before Linux 2.1.25.
69
70       -U uuid
71              Use the partition that has the specified uuid.
72
73       -v, --verbose
74              Be verbose.
75
76       -V, --version
77              Display version.
78

NOTES

80       You should not use swapon on a file with holes.  Swap over NFS may  not
81       work.
82
83       swapon automatically detects and rewrites swap space signature with old
84       software suspend data (e.g S1SUSPEND, S2SUSPEND, ...). The  problem  is
85       that  if  we  don't do it, then we get data corruption the next time an
86       attempt at unsuspending is made.
87

SEE ALSO

89       swapon(2), swapoff(2), fstab(5), init(8), mkswap(8), rc(8), mount(8)
90

FILES

92       /dev/sd??  standard paging devices
93       /etc/fstab ascii filesystem description table
94

HISTORY

96       The swapon command appeared in 4.0BSD.
97

AVAILABILITY

99       The swapon command is part of the util-linux-ng package and  is  avail‐
100       able from ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.
101
102
103
104Linux 1.x                      25 September 1995                     SWAPON(8)
Impressum