]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
swapon: (man) cleanup note about holes
authorKarel Zak <kzak@redhat.com>
Mon, 21 Jan 2019 11:44:49 +0000 (12:44 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 21 Jan 2019 11:54:20 +0000 (12:54 +0100)
Addresses: https://github.com/karelzak/util-linux/issues/633
Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/mkswap.8
sys-utils/swapon.8

index 27f9221718e270c90aebc5ec0159772cb5393618..bdc631491c28f73e649c9aab36b83a86afa56b3a 100644 (file)
@@ -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.
 
index 510a15fd0195b8bae0f67a3704efbe73c64ebfe8..aea45b2f5865d49017dfe6dc02ba1125add9f9ca 100644 (file)
@@ -195,18 +195,16 @@ This can be seen in the system log as
 .B "swapon: swapfile has holes."
 .sp
 .RE
-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
-preallocated files (e.g.
-.BR fallocate (1))
-on filesystems like \fBXFS\fR or \fBext4\fR, and on copy-on-write
-filesystems like \fBbtrfs\fR.
-.PP
-It is recommended to use
+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)
+or another commands), or on files on copy-on-write filesystems like
+.BR btrfs .
+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
-.I /dev/zero
-to avoid holes on XFS and ext4.
+and /dev/zero in these cases.
 .PP
 .B swapon
 may not work correctly when using a swap file with some versions of