summaryrefslogtreecommitdiffstats
path: root/sys-utils/swapon.8
diff options
context:
space:
mode:
authorKarel Zak2019-01-22 10:13:54 +0100
committerKarel Zak2019-01-22 10:18:12 +0100
commit56c2d2904f018e08131bc0ef0c90b6c69b762268 (patch)
tree0c4c2fc34b58270cb8bbc61e55792fe0b86cb09b /sys-utils/swapon.8
parentswapon: rewrite section about swapfiles (diff)
downloadkernel-qcow2-util-linux-56c2d2904f018e08131bc0ef0c90b6c69b762268.tar.gz
kernel-qcow2-util-linux-56c2d2904f018e08131bc0ef0c90b6c69b762268.tar.xz
kernel-qcow2-util-linux-56c2d2904f018e08131bc0ef0c90b6c69b762268.zip
swapon: be more explicit about BTRFS
It seems nocow and nodatasum attributes are required. See btrfs_swap_activate() in https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ed46ff3d423780fa5173b38a844bf0fdb210a2a7 Addresses: https://github.com/karelzak/util-linux/issues/633 Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/swapon.8')
-rw-r--r--sys-utils/swapon.87
1 files changed, 4 insertions, 3 deletions
diff --git a/sys-utils/swapon.8 b/sys-utils/swapon.8
index 60e4d4feb..d645850bb 100644
--- a/sys-utils/swapon.8
+++ b/sys-utils/swapon.8
@@ -207,9 +207,10 @@ The most portable solution to create a swap file is to use
.BR dd (1)
and /dev/zero in these cases.
.SS Btrfs
-The swap files on btrfs are supported since Linux 5.0. The previous versions use
-copy-on-write semantic for the swap files, it means that the file location is may not be static
-and corruption can result.
+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.