summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2017-12-07 19:56:34 +0100
committerDavid Sterba <dsterba@suse.com>2018-01-08 18:15:24 +0100
commitfab56e8c8460170c9316e86f040352c6e5f8c4b0 (patch)
treea891a9d65426faab79fa654b7a5db50df5b2a849
parent0ba347f315435f8dd6d3158ac82ec104cff443a2 (diff)
btrfs-progs: docs: update manual for mkfs --shrink
Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r--Documentation/mkfs.btrfs.asciidoc21
-rw-r--r--mkfs/main.c1
2 files changed, 13 insertions, 9 deletions
diff --git a/Documentation/mkfs.btrfs.asciidoc b/Documentation/mkfs.btrfs.asciidoc
index 153bb87e..2a1c3592 100644
--- a/Documentation/mkfs.btrfs.asciidoc
+++ b/Documentation/mkfs.btrfs.asciidoc
@@ -100,18 +100,21 @@ Please see the mount option 'discard' for that in `btrfs`(5).
*-r|--rootdir <rootdir>*::
Populate the toplevel subvolume with files from 'rootdir'. This does not
-require root permissions and does not mount the filesystem.
+require root permissions to write the new files or to mount the filesystem.
+
-NOTE: This option may enlarge the image or file to ensure it's large enough to
-contain the files from 'rootdir'.
+NOTE: This option may enlarge the image or file to ensure it's big enough to
+contain the files from 'rootdir'. Since version 4.14.1 the filesystem size is
+not minimized. Please see option '--shrink' if you need that functionality.
-*--shrink*:
-Shrink the filesystem to its minimal size, only works with *-r|--rootdir*
-option.
+*--shrink*::
+Shrink the filesystem to its minimal size, only works with '--rootdir' option.
+
-NOTE: If the destination is regular file, this option will also reduce the
-file size. Or it will only reduce the filesystem available space.
-Extra space will not be usable unless resized using 'btrfs filesystem resize'.
+If the destination is a regular file, this option will also truncate the
+file to the minimal size. Otherwise it will reduce the filesystem available
+space. Extra space will not be usable unless the filesystem is mounted and
+resized using 'btrfs filesystem resize'.
++
+NOTE: prior to version 4.14.1, the shrinking was done automatically.
*-O|--features <feature1>[,<feature2>...]*::
A list of filesystem features turned on at mkfs time. Not all features are
diff --git a/mkfs/main.c b/mkfs/main.c
index d1b687d3..1a3852e4 100644
--- a/mkfs/main.c
+++ b/mkfs/main.c
@@ -352,6 +352,7 @@ static void print_usage(int ret)
printf(" creation:\n");
printf("\t-b|--byte-count SIZE set filesystem size to SIZE (on the first device)\n");
printf("\t-r|--rootdir DIR copy files from DIR to the image root directory\n");
+ printf("\t--shrink (with --rootdir) shrink the filled filesystem to minimal size\n");
printf("\t-K|--nodiscard do not perform whole device TRIM\n");
printf("\t-f|--force force overwrite of existing filesystem\n");
printf(" general:\n");