summaryrefslogtreecommitdiffstats
path: root/disk-utils
diff options
context:
space:
mode:
authorKarel Zak2019-01-21 12:44:49 +0100
committerKarel Zak2019-01-21 12:54:20 +0100
commiteebfa469fcd07eb020dc4d6f1ae1a661d4b365ee (patch)
tree8855288cd552443d83eee5f2a8c18e485cb0616a /disk-utils
parentmount: (man) add note about --all to remount desc (diff)
downloadkernel-qcow2-util-linux-eebfa469fcd07eb020dc4d6f1ae1a661d4b365ee.tar.gz
kernel-qcow2-util-linux-eebfa469fcd07eb020dc4d6f1ae1a661d4b365ee.tar.xz
kernel-qcow2-util-linux-eebfa469fcd07eb020dc4d6f1ae1a661d4b365ee.zip
swapon: (man) cleanup note about holes
Addresses: https://github.com/karelzak/util-linux/issues/633 Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'disk-utils')
-rw-r--r--disk-utils/mkswap.817
1 files changed, 9 insertions, 8 deletions
diff --git a/disk-utils/mkswap.8 b/disk-utils/mkswap.8
index 27f922171..bdc631491 100644
--- a/disk-utils/mkswap.8
+++ b/disk-utils/mkswap.8
@@ -130,17 +130,18 @@ e.g.\& using a command like
to create 8GiB swapfile.
-Note that a swap file must not contain any holes. Using
+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
+(e.g. created by
.BR cp (1)
-to create the file is not acceptable. Neither is use of
-.BR fallocate (1)
-on file systems that support preallocated files, such as
-.BR XFS " or " ext4 ,
-or on copy-on-write filesystems like
+or another commands), or on files on copy-on-write filesystems like
.BR btrfs .
-It is recommended to use
+In some cases preallocated files (e.g. fallocate(1) on XFS) maybe interpreted
+by kernel as files with holes too. The most portable solution is to use
.BR dd (1)
-and /dev/zero in these cases. Please read notes from
+and /dev/zero in these cases.
+.sp
+Please read notes from
.BR swapon (8)
before adding a swap file to copy-on-write filesystems.