Commit Graph

430 Commits

Author SHA1 Message Date
David Sterba e034d2bbaa btrfs-prog: docs: add recent new mount options and features
Signed-off-by: David Sterba <dsterba@suse.com>
2021-05-08 00:58:51 +02:00
David Sterba 1af37385e2 btrfs-progs: docs: move inode_cache to deprecated options
The inode_cache mount option does nothing since 5.11, update the docs.

Signed-off-by: David Sterba <dsterba@suse.com>
2021-05-08 00:58:50 +02:00
David Sterba 016aa9102a btrfs-progs: docs: how to use swapfile from fstab
This was asked on reddit, how to automatically mount a swapfile from
fstab. As this is not completely obvious, document it with an example.

Signed-off-by: David Sterba <dsterba@suse.com>
2021-05-06 16:41:44 +02:00
David Sterba 743d280915 btrfs-progs: docs: update chattr attribute for NOCOMPRESS
There were plans to add X as flag to set/unset the btrfs NOCOMPRESS
attribute but that never materialized. In e2fsprogs the letter 'm' has
been assigned to the same functionality and released in version 1.46.2.

Update the docs and mention that the compression options are
conflicting.

Signed-off-by: David Sterba <dsterba@suse.com>
2021-05-06 16:41:44 +02:00
David Sterba 4a9b83c7a4 btrfs-progs: docs: add more general ioctl description
Add general paragraphs and establish per-ioctl argument description
formatting, using [horizontal] where the struct member and the
description are on the same line, unlike ordinary ::.

Signed-off-by: David Sterba <dsterba@suse.com>
2021-03-24 22:20:19 +01:00
David Sterba cbadf0f1ae btrfs-progs: docs: change wording about required fsck
Make running the 'fsck' more explicit and add the commands with
recommended options.

Issue: #348
Signed-off-by: David Sterba <dsterba@suse.com>
2021-03-23 17:04:22 +01:00
David Sterba 922797e155 btrfs-progs: docs: add section about raid56
Used sources:

- wiki
- IRC discussions
- https://lore.kernel.org/linux-btrfs/20200627032414.GX10769@hungrycats.org

Signed-off-by: David Sterba <dsterba@suse.com>
2021-03-04 21:14:41 +01:00
David Sterba 2aeaea41a8 btrfs-progs: docs: add raid1c34 profiles to balance convert
The extended raid1 profiles are missing from the list.

Signed-off-by: David Sterba <dsterba@suse.com>
2021-03-04 21:14:41 +01:00
David Sterba 2910ca8009 btrfs-progs: balance: use --force to override timeout for raid56 conversions
Enhance --force to also skip the timeout, similar to what --full-balance
does. As this is only to warn about RAID56 that won't be necessary in
the future, don't add a separate option. The warning is still printed.

Signed-off-by: David Sterba <dsterba@suse.com>
2021-03-04 21:14:41 +01:00
David Sterba fc6818a46c btrfs-progs: docs: add section about seeding device
Issue: #341
Signed-off-by: David Sterba <dsterba@suse.com>
2021-03-01 16:47:15 +01:00
chrysn a7eca5cfe4 btrfs-progs: doc: snapshot -r and -i can be used together
This aligns the man page with the usage output of the tool, the notation
in the help text could be confusing as it reads like -r and -i are
mutually exclusive.

Signed-off-by: Christian Amsüss <chrysn@fsfe.org>
Signed-off-by: David Sterba <dsterba@suse.com>
2021-02-19 20:14:35 +01:00
Daniel Xu c11874ae81 btrfs-progs: rescue: add create-control-device subcommand
Add a new subcommand 'btrfs rescue create-control-device' that creates
/dev/btrfs-control. This is helpful on systems that may not have `mknod`
installed and the device node is missing for some reason.

Issue: #223
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
[ update docs ]
Signed-off-by: David Sterba <dsterba@suse.com>
2021-02-19 16:19:37 +01:00
David Sterba b691968d18 btrfs-progs: docs: clarify scrub requiring mounted filesystem
That scrub works only on a mounted filesystem is not clear in connection
with the possibility to start scrub on a given device. Update the manual
page and mention the mount requirement where approrpriate.

Issue: #335
Signed-off-by: David Sterba <dsterba@suse.com>
2021-01-29 15:12:34 +01:00
David Sterba f93d67ece1 btrfs-progs: docs: document command line conventions
First draft of the command line conventions regarding options, wording,
style and formatting.

Signed-off-by: David Sterba <dsterba@suse.com>
2021-01-18 20:53:23 +01:00
Eric Semeniuc d2316fdfd2 btrfs-progs: docs: grammar and typo fix for btrfs check
Pull-request: #9
Signed-off-by: David Sterba <dsterba@suse.com>
2021-01-18 17:49:23 +01:00
Adam Borowski c615287cc0 btrfs-progs: a bunch of typo fixes
Signed-off-by: Adam Borowski <kilobyte@angband.pl>
Signed-off-by: David Sterba <dsterba@suse.com>
2021-01-13 22:33:10 +01:00
Nikolay Borisov 04f1977832 btrfs-progs: check: add option to remove ino cache
Inode cache feature is going to be removed in kernel 5.11. After this
kernel version items left on disk by this feature will take some extra
space. Testing showed that the size is actually negligible but for
completeness' sake give ability to users to remove such left-overs.

This is achieved by iterating every fs root and removing respective
items as well as relevant csum extents since the ino cache used the csum
tree for csums.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2020-12-16 17:08:53 +01:00
David Sterba 5f7191135f btrfs-progs: fix short/long unit size options
The two variants of unit options are not suitable for all commands, the
short options could interfere with existing options or limit future
extensions.

In 'filesystem du' the short options are not documented neither in help
text, nor in documentation so fix the code

In 'scrub status' it's the same but the documentation needs to be fixed
as well.

Signed-off-by: David Sterba <dsterba@suse.com>
2020-12-16 17:08:52 +01:00
David Sterba 022168c32d btrfs-progs: subvol show: fix required arguments in help texts
The help text and documentation of the --rootid and --uuid parameters
is wrong as it does not say there's a required parameter. Add it and
enhance the docs to clarify what the options do.

Issue: #317
Signed-off-by: David Sterba <dsterba@suse.com>
2020-12-16 17:08:52 +01:00
David Sterba ffd1601236 btrfs-progs: docs: document fs exclusive operations
Signed-off-by: David Sterba <dsterba@suse.com>
2020-12-16 17:08:52 +01:00
David Sterba e198c6674a btrfs-progs: add enqueue parameter for exclusive ops
The exclusive ops will not start if there's one already running. Now
that we have the sysfs export (since kernel 5.10) to check if there's
one already running, use it to allow enqueueing of the operations as a
convenience.

Supported enqueuing:

  btrfs balance start --enqueue
  btrfs filesystem resize --enqueue
  btrfs device add --enqueue
  btrfs device delete --enqueue
  btrfs replace start --enqueue

This patch implements the functionality based on Goldwyn's patch
https://lore.kernel.org/linux-btrfs/?q=20200825150338.32610-4-rgoldwyn%40suse.de
but on top of previous preparatory patches.

Note that 'filesystem resize' options could confuse getopt as the
negative size change looks like a series of short options and there's no
way to make getopt ignore the short options, so there's a custom option
parser.

Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.de>
Signed-off-by: David Sterba <dsterba@suse.com>
2020-12-16 17:08:12 +01:00
Sidong Yang 0c77d2cd03 btrfs-progs: fi usage: add avail info from statfs()
Add available space information from statfs(). This can be different from
'Free (estimated)' in some cases. This patch provide more information
about filesystem usage like below.

Overall:
    Device size:                   5.00GiB
    Device allocated:              1.02GiB
    Device unallocated:            3.98GiB
    Device missing:                  0.00B
    Used:                         88.00KiB
    Free (estimated):              4.48GiB      (min: 2.49GiB)
    Free (statfs, df)              4.48GiB
    Data ratio:                       1.00
    Metadata ratio:                   2.00
    Global reserve:              832.00KiB      (used: 0.00B)
    Multiple profiles:                  no

Issue: #306
Signed-off-by: Sidong Yang <realwakka@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2020-12-10 17:10:30 +01:00
Tomasz Torcz 90e64aae4b btrfs-progs: docs: add info about "single" profile requirements for swapfile
The limitation is there since first commit implementing swapfiles support.

Pull-request: #315
Signed-off-by: Tomasz Torcz <tomek@pipebreaker.pl>
Signed-off-by: David Sterba <dsterba@suse.com>
2020-12-10 17:10:30 +01:00
David Sterba c4b84f1c5d btrfs-progs: docs: fix mknod arguments of the control device
The provided does not work, the name argument is in the wrong place.

Signed-off-by: David Sterba <dsterba@suse.com>
2020-11-06 14:35:10 +01:00
David Sterba cc2dd28136 btrfs-progs: docs: add missing option to scrub status
Signed-off-by: David Sterba <dsterba@suse.com>
2020-11-04 22:44:55 +01:00
David Sterba d60d48fce5 btrfs-progs: scrub status: add unit mode options
Add long options for size units, affecting total and currently scrubbed
bytes. The rate depends on the device speed and could be
disproportionate to the size so it is not affected, except the --raw
option that is in bytes without unit suffix.

Signed-off-by: David Sterba <dsterba@suse.com>
2020-11-04 22:44:36 +01:00
Sidong Yang 4179885cf9 btrfs-progs: docs: add qgroup examples
This patch adds examples section in btrfs-qgroup documentation.
The example make a quota group that has two subvolumes as children.

Signed-off-by: Sidong Yang <realwakka@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2020-10-02 20:12:09 +02:00
Forza-tng fbe95d714f btrfs-progs: docs: update limits for minimal device size
Add limits:

  # mkfs.btrfs loop.img
  btrfs-progs v5.7
  See http://btrfs.wiki.kernel.org for more information.

  ERROR: 'loop.img' is too small to make a usable filesystem
  ERROR: minimum size for each btrfs device is 114294784

  # mkfs.btrfs --mixed loop.img
  btrfs-progs v5.7
  See http://btrfs.wiki.kernel.org for more information.

  ERROR: 'loop.img' is too small to make a usable filesystem
  ERROR: minimum size for each btrfs device is 16777216

Pull-request: #287
Author: Forza-tng <Forza-tng@users.noreply.github.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2020-10-02 20:12:09 +02:00
Boris Burkov 92d92e99b7 btrfs-progs: mkfs: support free space tree as -R option
Add a runtime feature (-R) flag for the free space tree. A filesystem
that is mkfs'd with -R free-space-tree then mounted with no options has
the same contents as one mkfs'd without the option, then mounted with
'-o space_cache=v2'.

The only tricky thing is in exactly how to call the tree creation code.
Using btrfs_create_free_space_tree as is did not quite work, because an
extra reference to the eb (root->commit_root) is leaked, which mkfs
complains about with a warning. I opted to follow how the uuid tree is
created by adding it to the dirty roots list for cleanup by
commit_tree_roots in commit_transaction. As a result,
btrfs_create_free_space_tree no longer exactly matches the version in
the kernel sources.

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Boris Burkov <boris@bur.io>
Signed-off-by: David Sterba <dsterba@suse.com>
2020-09-08 22:06:04 +02:00
Marcos Paulo de Souza 56e8e90219 btrfs-progs: docs: remove nonexistent nousebackuproot option
Since it's inclusion in b3751c131a ("btrfs-progs: docs: update
btrfs-man5"), this option has never been available in kernel as
usebackuproot is a one-time mount option.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2020-08-31 17:01:03 +02:00
David Sterba 9f5df56f73 btrfs-progs: docs: update profiles
- add missing raid1c34 profiles to the list of supported profiles
- document defaults change in 5.8
- update wording

Signed-off-by: David Sterba <dsterba@suse.com>
2020-07-22 11:36:59 +02:00
David Sterba ffd3b4cda2 btrfs-progs: docs: note when subvolume cannot be deleted
Signed-off-by: David Sterba <dsterba@suse.com>
2020-07-14 15:04:05 +02:00
David Sterba b677e6bb03 btrfs-progs: docs: remove deprecated alloc_start and subvolrootid
The options have been deprecated for a long time, the kernel mount
options are being removed too (in 5.9).

Signed-off-by: David Sterba <dsterba@suse.com>
2020-07-03 14:21:17 +02:00
David Sterba 4bd94dba8a btrfs-progs: mkfs: remove alloc start options and docs
The option -A was used long time ago for debugging and marked as
obsolete since 4.14.1. Remove the option and set the alloc start to the
default value 1MiB.

Signed-off-by: David Sterba <dsterba@suse.com>
2020-07-02 22:24:34 +02:00
David Sterba 27a65e016e btrfs-progs: deprecate subcommand specific verbose/quiet options
Many subcommands have their own verbosity options that are being
superseded by the global options. Update the help text to reflect that
where applicable.

Signed-off-by: David Sterba <dsterba@suse.com>
2020-06-29 17:45:40 +02:00
David Sterba 94dbcc2958 btrfs-progs: docs: update bootloader section
Add reference to u-boot and primary super block offset.

Signed-off-by: David Sterba <dsterba@suse.com>
2020-06-18 11:41:57 +02:00
David Sterba f1a1184f2c btrfs-progs: fi defrag: clarify recursive mode
Directory symlinks are not followed in the recursive mode, add that to
the documentation.

Signed-off-by: David Sterba <dsterba@suse.com>
2020-06-17 22:11:12 +02:00
David Sterba 9532249690 btrfs-progs: docs: clarify balance regarding extent sharing
Based on user questions, the word 'rewrite' may sound confusing as the
defragmetation also rewrites data but break extent sharing, while
balance does not do that.

Signed-off-by: David Sterba <dsterba@suse.com>
2020-06-17 21:19:21 +02:00
David Sterba 7e3f269cb9 btrfs-progs: docs: remove option logreplay
There's no such option 'logreplay', only 'nologreplay'. Remove it from
the list and update the help text.

Signed-off-by: David Sterba <dsterba@suse.com>
2020-06-10 17:27:11 +02:00
David Sterba 70e3d52d7b btrfs-progs: docs: add discard=async to mount options
Document the new discard mode.

Signed-off-by: David Sterba <dsterba@suse.com>
2020-06-09 22:19:10 +02:00
David Sterba 62ee9a50bf btrfs-progs: docs: update conventions
Rename to asciidoc as that's the format we use for manual page source.

Signed-off-by: David Sterba <dsterba@suse.com>
2020-06-09 22:19:09 +02:00
David Sterba b79683252a btrfs-progs: docs: update balance
- note the faster cancellation
- redundancy reduction
- system also gets converted with metadata conversion

Signed-off-by: David Sterba <dsterba@suse.com>
2020-06-09 22:19:09 +02:00
David Sterba 0015e8ff26 btrfs-progs: docs: clarify file attributes and flags
Signed-off-by: David Sterba <dsterba@suse.com>
2020-06-09 22:19:09 +02:00
David Sterba 7462b0af16 btrfs-progs: docs: update list of features exported in sysfs
List remaining entries in /sys/fs/btrfs/features available in kernel
5.6.

Signed-off-by: David Sterba <dsterba@suse.com>
2020-06-09 22:19:09 +02:00
David Sterba ba689a384f btrfs-progs: docs: update 'fi us' examples
Add description of each line, update the per-type output.

Signed-off-by: David Sterba <dsterba@suse.com>
2020-05-29 12:42:49 +02:00
Qu Wenruo 6ee4ab24da btrfs-progs: mkfs: introduce quota runtime feature
Add support for enabling quotas at mkfs time. The qgroup accounting will
be consistent, ie. works with --rootdir.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2020-05-28 19:59:56 +02:00
Qu Wenruo 5ac6e02665 btrfs-progs: mkfs: add -R|--runtime-features option
Just like -O|--features, introduce -R|--runtime-features to enable
features that are now enabled on a mounted filesystem

Currently only mkfs is supported, convert is not supported yet.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2020-05-28 19:59:56 +02:00
David Sterba 0fc5b550e3 btrfs-progs: docs: update section about multiple block group profiles
Signed-off-by: David Sterba <dsterba@suse.com>
2020-05-05 17:08:20 +02:00
David Sterba d617327acb btrfs-progs: docs: clarify mount options
Issue: 246
Signed-off-by: David Sterba <dsterba@suse.com>
2020-05-04 20:49:01 +02:00
Alexandru Ungureanu 6ffdd00e79 btrfs-progs: docs: add example on deleting a subvolume
Perhaps a rather trivial example but I find it helpful to see usage
examples. Maybe it will help others.

Pull-request: #244
Author: Alexandru Ungureanu <khakcarot@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2020-05-04 20:48:58 +02:00