aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2022-11-07 21:10:42 +0100
committerDavid Sterba <dsterba@suse.com>2022-11-08 11:30:21 +0100
commit90548b829575c9dd0cf3a0a073f4bf667d911634 (patch)
treedf1cdc9ca6eea74bfb40a67407905511ee80f8ec /Documentation
parent441d01556873385d55fd4940f50ee7ae1fcfb13d (diff)
downloadbtrfs-progs-90548b829575c9dd0cf3a0a073f4bf667d911634.tar.gz
btrfs-progs: filesystem: new subcommand mkswapfile
Add a command to create a new swapfile. The same can be achieved by seandalone tools but they're just wrappers around the syscalls. The swap format is simple enough to be created directly without mkswap command so the swapfile can be created in one go. The file must not exist before, this is to avoid problems with file attributes or any other effects of existing extents. This also means the command can't be used on block devices. Default size is 2G, minimum size is 40KiB. Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/btrfs-filesystem.rst17
1 files changed, 17 insertions, 0 deletions
diff --git a/Documentation/btrfs-filesystem.rst b/Documentation/btrfs-filesystem.rst
index 55f49ef6..b94756ae 100644
--- a/Documentation/btrfs-filesystem.rst
+++ b/Documentation/btrfs-filesystem.rst
@@ -188,6 +188,23 @@ label [<device>|<mountpoint>] [<newlabel>]
The maximum allowable length shall be less than 256 chars and must not contain
a newline. The trailing newline is stripped automatically.
+mkswapfile [-s size] file
+ Create a new file that's suitable and formatted as a swapfile. Default
+ size is 2GiB, minimum size is 40KiB.
+
+ A swapfile must be created in a specific way: NOCOW and preallocated.
+ Subvolume containing a swapfile cannot be snapshotted and blocks of an
+ activated swapfile cannot be balanced.
+
+ Swapfile creation can be achieved by standalone commands too. Activation
+ needs to be done by command ``swapon(8)``.
+
+ ``Options``
+
+ -s|--size SIZE
+ Create swapfile of a given size SIZE (accepting k/m/g/e/p
+ suffix).
+
resize [options] [<devid>:][+/-]<size>[kKmMgGtTpPeE]|[<devid>:]max <path>
Resize a mounted filesystem identified by *path*. A particular device
can be resized by specifying a *devid*.