From e07fdac476cb1c52962ec82a1b12c6afc111bd08 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 20 Oct 2014 10:59:08 +0200 Subject: swapon: add -o for compatibility with mount The new option allows to specify swap options by fstab compatible string. The concept is the same as for mount(8). swapon -o pri=1,discard=pages,nofail /dev/sda2 The advantage is that tools (like systmed) that parses fstab can call swapon without translation from fstab options to swapon(8) command line options. Signed-off-by: Karel Zak --- sys-utils/swapon.8 | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'sys-utils/swapon.8') diff --git a/sys-utils/swapon.8 b/sys-utils/swapon.8 index 34118fbf4..e88e2f1b2 100644 --- a/sys-utils/swapon.8 +++ b/sys-utils/swapon.8 @@ -130,6 +130,18 @@ Use the partition that has the specified .I /proc/partitions is needed.) .TP +.BR \-o , " \-\-options " \fIopts\fP +Specify swap options by fstab compatible comma separated string. For example: +.RS +.RS +.sp +.B "swapon -o pri=1,discard=pages,nofail /dev/sda2" +.sp +.RE +The \fIopts\fP string is evaluated as the last and overrides all another +options. +.RE +.TP .BR \-p , " \-\-priority " \fIpriority\fP Specify the priority of the swap device. .I priority @@ -149,10 +161,8 @@ Display swap usage summary by device. Equivalent to "cat /proc/swaps". Not available before Linux 2.1.25. This output format is DEPRECATED in favour of \fB\-\-show\fR that provides better control on output data. .TP -.BR \-\-show " [\fIcolumn\fR, ...]" -Display definable device table similar to -.B \-\-summary -output. See +.BR " \-\-show" [ =\fIcolumn\fR] +Display definable table of swap areas. See .B \-\-help output for a list of available columns. .TP -- cgit v1.2.3-55-g7522