summaryrefslogtreecommitdiffstats
path: root/sys-utils/swapon.8
diff options
context:
space:
mode:
authorMarcos Mello2019-03-11 11:30:35 +0100
committerMarcos Mello2019-03-11 11:30:35 +0100
commit63391d7579a4bf4d3a044d14aea0ceba5b028083 (patch)
tree9375b5c94bdab886da657781d8c5ddc6c7c50d7a /sys-utils/swapon.8
parentMerge branch 'setterm' of https://github.com/jwilk-forks/util-linux (diff)
downloadkernel-qcow2-util-linux-63391d7579a4bf4d3a044d14aea0ceba5b028083.tar.gz
kernel-qcow2-util-linux-63391d7579a4bf4d3a044d14aea0ceba5b028083.tar.xz
kernel-qcow2-util-linux-63391d7579a4bf4d3a044d14aea0ceba5b028083.zip
swapon.8: mention btrfs(5)
See: https://github.com/kdave/btrfs-progs/commit/5c880c82c2044b0abae5c838c733a2e6522ed122
Diffstat (limited to 'sys-utils/swapon.8')
-rw-r--r--sys-utils/swapon.829
1 files changed, 14 insertions, 15 deletions
diff --git a/sys-utils/swapon.8 b/sys-utils/swapon.8
index d645850bb..d01f681f8 100644
--- a/sys-utils/swapon.8
+++ b/sys-utils/swapon.8
@@ -189,31 +189,29 @@ Be verbose.
Display version information and exit.
.SH NOTES
.SS Files with holes
-The swap file implementation in the kernel expects to be able to write to the file directly,
-without the assistance of the filesystem. This is a problem on files with holes
-or on copy-on-write files on filesystems like btrfs.
+The swap file implementation in the kernel expects to be able to write to the
+file directly, without the assistance of the filesystem. This is a problem on
+files with holes or on copy-on-write files on filesystems like Btrfs.
.sp
-The commands like
+Commands like
.BR cp (1)
or
.BR truncate (1)
create files with holes. These files will be rejected by swapon.
.sp
-In some cases preallocated files (e.g. fallocate(1) on XFS) maybe interpreted
-by old kernel versions as files with holes too. The preallocated swap files on XFS are
-supported since Linux 4.18.
+Preallocated files created by
+.BR fallocate (1)
+may be interpreted as files with holes too depending of the filesystem.
+Preallocated swap files are supported on XFS since Linux 4.18.
.sp
The most portable solution to create a swap file is to use
.BR dd (1)
-and /dev/zero in these cases.
+and /dev/zero.
.SS Btrfs
-The swap files on btrfs are supported since Linux 5.0 on files with nocow and
-nodatasum attributes and without compression. The previous versions may use
-copy-on-write semantic for the swap files, it means that the file location is
-may not be static and corruption can result.
-.sp
-One possible workaround is to map the swap file to a loopback device. This will allow the filesystem
-to determine the mapping properly but may come with a performance impact.
+Swap files on Btrfs are supported since Linux 5.0 on files with nocow attribute.
+See the
+.BR btrfs (5)
+manual page for more details.
.SS NFS
Swap over \fBNFS\fR may not work.
.SS Suspend
@@ -233,6 +231,7 @@ enables libblkid debug output.
.BR swapon (2),
.BR fstab (5),
.BR init (8),
+.BR fallocate (1),
.BR mkswap (8),
.BR mount (8),
.BR rc (8)