~ubuntu-branches/ubuntu/trusty/util-linux/trusty-proposed

« back to all changes in this revision

Viewing changes to mount/swapon.8

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones
  • Date: 2011-05-11 08:38:31 UTC
  • mfrom: (1.3.10 upstream)
  • mto: (1.6.3 upstream) (4.5.5 sid)
  • mto: This revision was merged to the branch mainline in revision 82.
  • Revision ID: james.westby@ubuntu.com-20110511083831-tty7wnezw55fmrn4
ImportĀ upstreamĀ versionĀ 2.19.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
.br
55
55
.in +5
56
56
.B swapon
 
57
.RB [ \-d ]
57
58
.RB [ \-f ]
58
59
.RB [ \-p
59
60
.IR priority ]
111
112
are made available, except for those with the ``noauto'' option.
112
113
Devices that are already being used as swap are silently skipped.
113
114
.TP
 
115
.B "\-d, \-\-discard"
 
116
Discard freed swap pages before they are reused, if the swap
 
117
device supports the discard or trim operation.  This may improve
 
118
performance on some Solid State Devices, but often it does not.
 
119
The
 
120
.I /etc/fstab
 
121
mount option
 
122
.BI discard
 
123
may be also used to enable discard flag.
 
124
.TP
114
125
.B "\-e, \-\-ifexists"
115
126
Silently skip devices that do not exist.
 
127
The
 
128
.I /etc/fstab
 
129
mount option
 
130
.BI nofail
 
131
may be also used to skip non-existing device.
 
132
 
116
133
.TP
117
134
.B "\-f, \-\-fixpgsz"
118
135
Reinitialize (exec /sbin/mkswap) the swap space if its page size does not
167
184
suspend data (e.g S1SUSPEND, S2SUSPEND, ...). The problem is that if we don't
168
185
do it, then we get data corruption the next time an attempt at unsuspending is
169
186
made.
 
187
.PP
 
188
.B swapon
 
189
may not work correctly when using a swap file with some versions of btrfs.
 
190
This is due to the swap file implementation in the kernel expecting to be able
 
191
to write to the file directly, without the assistance of the file system.
 
192
Since btrfs is a copy-on-write file system, the file location may not be
 
193
static and corruption can result. Btrfs actively disallows the use of files
 
194
on its file systems by refusing to map the file. This can be seen in the system
 
195
log as "swapon: swapfile has holes." One possible workaround is to map the
 
196
file to a loopback device. This will allow the file system to determine the
 
197
mapping properly but may come with a performance impact.
 
198
 
170
199
.SH SEE ALSO
171
200
.BR swapon (2),
172
201
.BR swapoff (2),
187
216
.B swapon
188
217
command appeared in 4.0BSD.
189
218
.SH AVAILABILITY
190
 
The swapon command is part of the util-linux-ng package and is available from
191
 
ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.
 
219
The swapon command is part of the util-linux package and is available from
 
220
ftp://ftp.kernel.org/pub/linux/utils/util-linux/.