Commit graph

721 commits

Author SHA1 Message Date
David Sterba f7456830d1 btrfs-progs: docs: merge storage model to hardware chapter
The storage model is the intro chapter for the hardware problems.

Signed-off-by: David Sterba <dsterba@suse.com>
2022-05-17 21:12:19 +02:00
David Sterba 4c5554d46d btrfs-progs: docs: separate chapter for hardware considerations
Make it more visible than just in section 5.

Signed-off-by: David Sterba <dsterba@suse.com>
2022-05-17 21:12:19 +02:00
David Sterba f1b4ef2f35 btrfs-progs: docs: move flexibility to Administration
Signed-off-by: David Sterba <dsterba@suse.com>
2022-05-17 21:12:19 +02:00
David Sterba 0539bbb66a btrfs-progs: docs: separate filesystem limits chapter
For section 5 and Administration.

Signed-off-by: David Sterba <dsterba@suse.com>
2022-05-17 21:12:19 +02:00
David Sterba 1a431b0837 btrfs-progs: docs: document paused balance
Signed-off-by: David Sterba <dsterba@suse.com>
2022-05-17 21:12:19 +02:00
David Sterba 908a46085c btrfs-progs: docs: separate bootloaders chapter
Used in manual page section 5 and Administration overview.

Signed-off-by: David Sterba <dsterba@suse.com>
2022-05-17 21:12:19 +02:00
David Sterba b6e15650b2 btrfs-progs: docs: add note about ifdef EXPERIMENTAL
Signed-off-by: David Sterba <dsterba@suse.com>
2022-05-12 14:02:51 +02:00
David Sterba d619bb3192 btrfs-progs: docs: link INSTALL to docs
The INSTALL format renders fine as RST, add it to the main page.

Signed-off-by: David Sterba <dsterba@suse.com>
2022-05-12 13:56:03 +02:00
David Sterba df77a231bb btrfs-progs: docs: move glossary to overview sections
The glossary is reasonably complete so make it more visible in the main
section.

Signed-off-by: David Sterba <dsterba@suse.com>
2022-05-10 15:50:10 +02:00
David Sterba 2f83d94013 btrfs-progs: reformat CHANGES for RST
Add headings to versions, reorder so the minor releases are under the
major so it's properly nested, keep the last version expanded.

Signed-off-by: David Sterba <dsterba@suse.com>
2022-04-27 19:50:59 +02:00
Li Zhang 7781d1a2da btrfs-progs: props: don't translate value of compression=none
Currently, if user specifies value 'no' or 'none' on the command line,
it gets translated to an empty value that is passed to kernel. There was
a change in kernel 5.14 done by commit 5548c8c6f55b ("btrfs: props:
change how empty value is interpreted") that changes the behaviour
in that case.

The empty value is supposed to mean 'the default value' for any
property. For compression there is a need to distinguish resetting the
value and also setting the NOCOMPRESS property. The translation to empty
value makes that impossible.

The explanation and behaviour copied from the kernel patch:

    Old behaviour:

      $ lsattr file
      ---------------------- file
      # the NOCOMPRESS bit is set
      $ btrfs prop set file compression ''
      $ lsattr file
      ---------------------m file

    This is equivalent to 'btrfs prop set file compression no' in current
    btrfs-progs as the 'no' or 'none' values are translated to an empty
    string.

    This is where the new behaviour is different: empty string drops the
    compression flag (-c) and nocompress (-m):

      $ lsattr file
      ---------------------- file
      # No change
      $ btrfs prop set file compression ''
      $ lsattr file
      ---------------------- file
      $ btrfs prop set file compression lzo
      $ lsattr file
      --------c------------- file
      $ btrfs prop get file compression
      compression=lzo
      $ btrfs prop set file compression ''
      # Reset to the initial state
      $ lsattr file
      ---------------------- file
      # Set NOCOMPRESS bit
      $ btrfs prop set file compression no
      $ lsattr file
      ---------------------m file

    This obviously brings problems with backward compatibility, so this
    patch should not be backported without making sure the updated
    btrfs-progs are also used and that scripts have been updated to use the
    new semantics.

    Summary:

    - old kernel:
      no, none, "" - set NOCOMPRESS bit
    - new kernel:
      no, none - set NOCOMPRESS bit
      "" - drop all compression flags, ie. COMPRESS and NOCOMPRESS

Signed-off-by: Li Zhang <zhanglikernel@gmail.com>
[ update changelog ]
Signed-off-by: David Sterba <dsterba@suse.com>
2022-04-25 18:30:28 +02:00
David Sterba 9091be2a4b btrfs-progs: docs: document generic error
Signed-off-by: David Sterba <dsterba@suse.com>
2022-03-08 18:11:40 +01:00
David Sterba f1e54a0c09 btrfs-progs: build: use rm for cleaning build directory
'make clean' can fail in case the _build directory is not present, can
be observed with the build-tests.sh. Use plain 'rm -fd'.

Signed-off-by: David Sterba <dsterba@suse.com>
2022-03-08 18:11:40 +01:00
David Sterba 7421398be8 btrfs-progs: docs: update file attributes
Use the file attributes chapter also in the common linux features page.

Signed-off-by: David Sterba <dsterba@suse.com>
2022-03-08 18:11:40 +01:00
David Sterba dceb496d19 btrfs-progs: docs: set version from VERSION file
Signed-off-by: David Sterba <dsterba@suse.com>
2022-02-16 23:24:12 +01:00
David Sterba e841c811d6 btrfs-progs: docs: generate section 5 to final name directly
There was a workaround for asciidoc/xmlto build because page btrfs.5 and
btrfs.8 used the same intermediate file. To avoid clash for the section
5 page it is part of the name, this is still needed, but for sphinx we
can use the final name as it will get the right suffix. This affects
only the generated manual pages.

Signed-off-by: David Sterba <dsterba@suse.com>
2022-02-16 23:24:12 +01:00
David Sterba 134f5bffc9 btrfs-progs: docs: remove all converted asciidoc sources
Remove all docs that have a RST version. Remaining: btrfs-ioctl.asciidoc
and DocConventions.asciidoc.

Signed-off-by: David Sterba <dsterba@suse.com>
2022-02-16 23:24:12 +01:00
David Sterba f5d6bfaed0 btrfs-progs: docs: remove asciidoc build support
Remove asciidoc makefile support and config files.

Signed-off-by: David Sterba <dsterba@suse.com>
2022-02-16 23:24:12 +01:00
David Sterba 45d4edaf97 btrfs-progs: build: drop asciidoc detection, default to sphinx
Make sphinx the default build tool, remove asciidoc target selection.

Signed-off-by: David Sterba <dsterba@suse.com>
2022-02-16 23:24:12 +01:00
David Sterba 2e0c6ca308 btrfs-progs: docs: add remaining targets for sphinx build
Update sphinx build so that by default it now builds the manual pages,
in quiet mode. 'make html' builds the html, other sphinx targets are
available, see 'make help'. Installation now works as well.

Note: sphinx is still conditional and must be selected by
ASCIIDOOC_TOOL=sphinx ./configure

Signed-off-by: David Sterba <dsterba@suse.com>
2022-02-16 23:24:12 +01:00
Philip Guyton 4260413a0d btrfs-progs: docs: update remaining non-zero dev stats -s option to -c
Update the remaining erroneous entry of -s in the 'exit status' section
to -c in accordance with the changes made in:

"btrfs-progs: dev stats: update option name for checking non-zero status"

Pull-request: #146
Signed-off-by: Philip Guyton <philip@yewtreeapps.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2022-02-16 22:48:01 +01:00
dathide b2acf53520 btrfs-progs: docs: remove incorrect statement about mkfs runtime features
Since 5.15 enables a runtime feature, this statement is incorrect.

Pull-request: #437
Author: dathide <47128084+dathide@users.noreply.github.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2022-02-16 22:48:01 +01:00
jtagcat 9d85418c52 btrfs-progs: docs: clarify zstd level mapping
Question forwarded from wiki:
  https://btrfs.wiki.kernel.org/index.php?title=Talk:Compression&diff=0&oldid=33545

  (info few months old) higher levels: upstream and library has levels 1..22.

      mapping to the upstream levels 1 to 15

As implemented in kernel zstd.c, max level is 15 and the level selection
is direct without any translation.

Pull-request: #442
Author: jtagcat <git-12dbd862@jtag.cat>
[ update changelog ]
Signed-off-by: David Sterba <dsterba@suse.com>
2022-02-16 22:48:01 +01:00
Adam Borowski 6da5478a38 btrfs-progs: fix a bunch of typos
These have been detected by lintian and codespell.

Signed-off-by: Adam Borowski <kilobyte@angband.pl>
Signed-off-by: David Sterba <dsterba@suse.com>
2022-02-01 18:40:53 +01:00
David Sterba 23bdd548d8 btrfs-progs: docs: split mount options
Signed-off-by: David Sterba <dsterba@suse.com>
2022-01-12 00:09:29 +01:00
David Sterba 864d260154 btrfs-progs: docs: split swapfile from section 5
Signed-off-by: David Sterba <dsterba@suse.com>
2022-01-11 23:56:48 +01:00
David Sterba 5004a7de0a btrfs-progs: docs: update template, more about subvolumes
The max width of the page is set to 800px, that renders of commands and
output in a small box requiring a scrollbar. Increase the limit to
1200px. Also update some subvoulme related text.

Signed-off-by: David Sterba <dsterba@suse.com>
2022-01-11 15:46:33 +01:00
David Sterba 79ef78f0e4 btrfs-progs: docs: more docs updates
Signed-off-by: David Sterba <dsterba@suse.com>
2022-01-10 16:20:34 +01:00
David Sterba df91bfd5d5 btrfs-progs: docs: update some chapters
Signed-off-by: David Sterba <dsterba@suse.com>
2022-01-05 00:44:14 +01:00
David Sterba 208aed2ed4 btrfs-progs: docs: add more chapters (part 3)
All main pages have some content and many typos have been fixed.

Signed-off-by: David Sterba <dsterba@suse.com>
2021-12-17 15:35:10 +01:00
David Sterba c6be84840f btrfs-progs: docs: add more chapters (part 2)
The feature pages share the contents with the manual page section 5 so
put the contents to separate files. Progress: 2/3.

Signed-off-by: David Sterba <dsterba@suse.com>
2021-12-17 11:53:44 +01:00
David Sterba b871bf49f3 btrfs-progs: docs: add more chapters
The feature pages share the contents with the manual page section 5 so
put the contents to separate files.

Signed-off-by: David Sterba <dsterba@suse.com>
2021-12-17 11:53:44 +01:00
David Sterba 9756d90ce3 btrfs-progs: docs: add more of the new doc structure
Add overall structure for now, some contents is from wiki.

Signed-off-by: David Sterba <dsterba@suse.com>
2021-11-30 16:00:48 +01:00
David Sterba ee801c07d7 btrfs-progs: docs: drop indices from pages
At this point it's not clear what exactly needs the indices and they
appear in the left column with list of index pages which is a bit
confusing.

Signed-off-by: David Sterba <dsterba@suse.com>
2021-11-26 00:48:24 +01:00
Qu Wenruo 77db6bd402 btrfs-progs: rescue: introduce clear-uuid-tree
[BUG]
There is a bug report that a corrupted key type (expected
UUID_KEY_SUBVOL, has EXTENT_ITEM) causing newer kernel to reject a
mount.

Although the root cause is not determined yet, with roll out of v5.11
kernel to various distros, such problem should be prevented by
tree-checker, no matter if it's hardware problem or not.

And older kernel with "-o uuid_rescan" mount option won't help, as
uuid_rescan will only delete items with
UUID_KEY_SUBVOL/UUID_KEY_RECEIVED_SUBVOL key types, not deleting such
corrupted key.

[FIX]
To fix such problem we have to rely on offline tool, thus there we
introduce a new rescue tool, clear-uuid-tree, to empty and then remove
uuid tree.

Kernel will re-generate the correct uuid tree at next mount.

Reported-by: S. <sb56637@gmail.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2021-11-22 21:45:37 +01:00
David Sterba e7b4845d8f btrfs-progs: docs: mention ntfs2btrfs conversion tool
There's another tool for in-place filesystem conversion, from NTFS to
BTRFS.

Signed-off-by: David Sterba <dsterba@suse.com>
2021-11-18 10:17:21 +01:00
David Sterba 4a50f64614 btrfs-progs: docs: integrate sphinx build
Make it possible to select sphinx doc generator instead of asciidoc so
we don't have two makefiles for that. It's still a bit crude and does
not support installing the files.

The required package is python-Sphinx (or similar name), built by
'sphinx-build'.

Configure:

  $ ASCIIDOC_TOOL=sphinx ./configure
  ...
            doc generator:      sphinx
  ...

Generate:

  $ cd Documentation/
  $ make man
  $ make html
  $ make info           # yes we can have info pages too

There are several more targets provided by sphinx, run 'make' to list
them.

Signed-off-by: David Sterba <dsterba@suse.com>
2021-11-18 10:17:21 +01:00
David Sterba a079982a9e btrfs-progs: docs: disable RST smartquotes for em-dash
All long command line options in the html target render as a single
character which is confusing and wrong as we expect that to be '--'.
Disable it.

Signed-off-by: David Sterba <dsterba@suse.com>
2021-11-18 10:17:21 +01:00
David Sterba c1046aeda7 btrfs-progs: docs: fix RST mkfs.btrfs table formatting
Cell spanning is not supported for manual page target, so add separate
columns for the redundancy numbers.

Signed-off-by: David Sterba <dsterba@suse.com>
2021-11-18 10:17:21 +01:00
David Sterba 8b928ca5fb btrfs-progs: docs: RST formatting fixups
- verbatim quoting
- code-block directive spacing
- definition list spacing

Signed-off-by: David Sterba <dsterba@suse.com>
2021-11-18 10:17:21 +01:00
David Sterba b1ae8ccb21 btrfs-progs: docs: add Glossary from wiki
Start a new section with wiki pages that will be hosted here as well.

Signed-off-by: David Sterba <dsterba@suse.com>
2021-11-18 10:17:21 +01:00
David Sterba cc8a100c90 btrfs-progs: docs: convert btrfs(5) to rst
Signed-off-by: David Sterba <dsterba@suse.com>
2021-10-29 17:30:04 +02:00
David Sterba c52b6d9473 btrfs-progs: docs: convert mkfs.btrfs to rst
Signed-off-by: David Sterba <dsterba@suse.com>
2021-10-29 17:30:04 +02:00
David Sterba 2ba78e5ed0 btrfs-progs: docs: convert btrfs(8) to rst
Signed-off-by: David Sterba <dsterba@suse.com>
2021-10-29 17:30:04 +02:00
David Sterba 71b1306fda btrfs-progs: docs: convert btrfs-map-logical to rst
Signed-off-by: David Sterba <dsterba@suse.com>
2021-10-29 17:30:04 +02:00
David Sterba f03df4f256 btrfs-progs: docs: convert btrfs-subvolume to rst
Signed-off-by: David Sterba <dsterba@suse.com>
2021-10-29 17:30:04 +02:00
David Sterba d3e7d66ae4 btrfs-progs: docs: convert btrfs-balance to rst
Signed-off-by: David Sterba <dsterba@suse.com>
2021-10-29 17:30:04 +02:00
David Sterba 6b322fd12a btrfs-progs: docs: convert btrfs-check to rst
Signed-off-by: David Sterba <dsterba@suse.com>
2021-10-29 17:30:04 +02:00
David Sterba 9111518193 btrfs-progs: docs: convert btrfs-convert to rst
Signed-off-by: David Sterba <dsterba@suse.com>
2021-10-29 17:30:04 +02:00
David Sterba 2685136fa1 btrfs-progs: docs: convert btrfs-device to rst
Signed-off-by: David Sterba <dsterba@suse.com>
2021-10-29 17:30:04 +02:00
David Sterba 0f6a5c3847 btrfs-progs: docs: convert btrfs-filesystem to rst
Signed-off-by: David Sterba <dsterba@suse.com>
2021-10-29 17:30:04 +02:00
David Sterba 48b43e0d3a btrfs-progs: docs: convert btrfs-find-root to rst
Signed-off-by: David Sterba <dsterba@suse.com>
2021-10-29 17:30:04 +02:00
David Sterba fb9c88fa93 btrfs-progs: docs: convert btrfs-image to rst
Signed-off-by: David Sterba <dsterba@suse.com>
2021-10-29 17:30:04 +02:00
David Sterba 110d2be843 btrfs-progs: docs: convert btrfs-inspect-internal to rst
Signed-off-by: David Sterba <dsterba@suse.com>
2021-10-29 17:30:04 +02:00
David Sterba 26a7720748 btrfs-progs: docs: convert btrfs-property to rst
Signed-off-by: David Sterba <dsterba@suse.com>
2021-10-29 17:30:03 +02:00
David Sterba 2f947467f6 btrfs-progs: docs: convert btrfs-qgroup to rst
Signed-off-by: David Sterba <dsterba@suse.com>
2021-10-29 17:30:03 +02:00
David Sterba 7cd4302a57 btrfs-progs: docs: convert btrfs-quota to rst
Signed-off-by: David Sterba <dsterba@suse.com>
2021-10-29 17:30:03 +02:00
David Sterba 964c94fb81 btrfs-progs: docs: convert btrfs-receive to rst
Signed-off-by: David Sterba <dsterba@suse.com>
2021-10-29 17:30:03 +02:00
David Sterba 2c7869dc3a btrfs-progs: docs: convert btrfs-replace to rst
Signed-off-by: David Sterba <dsterba@suse.com>
2021-10-29 17:30:03 +02:00
David Sterba efaf218a80 btrfs-progs: docs: convert btrfs-rescue to rst
Signed-off-by: David Sterba <dsterba@suse.com>
2021-10-29 17:30:03 +02:00
David Sterba 0f4f3b0c72 btrfs-progs: docs: convert btrfs-restore to rst
Signed-off-by: David Sterba <dsterba@suse.com>
2021-10-29 17:30:03 +02:00
David Sterba 0360969430 btrfs-progs: docs: convert btrfs-scrub to rst
Signed-off-by: David Sterba <dsterba@suse.com>
2021-10-29 17:30:03 +02:00
David Sterba f3b88e6b75 btrfs-progs: docs: convert btrfs-send to rst
Signed-off-by: David Sterba <dsterba@suse.com>
2021-10-29 17:30:03 +02:00
David Sterba e508e6707d btrfs-progs: docs: convert fsck.btrfs to rst
Signed-off-by: David Sterba <dsterba@suse.com>
2021-10-29 17:30:03 +02:00
David Sterba df04fbceec btrfs-progs: docs: convert btrfstune to rst
Signed-off-by: David Sterba <dsterba@suse.com>
2021-10-29 17:30:03 +02:00
David Sterba 4110fbc46f btrfs-progs: docs: add sample RSTified manual page
The asciidoc format needs to be tweaked but otherwise is basically the
same. Changes:

- bold text is ** **
- italics is * *
- NOTE is directive .. note
- definition list is simple indented block after the term
- section NAME in the manual page is generated from date in
  conf.py:man_pages
- new page has to be added to the index

To do:

- references to other manual pages, will be RST native linking once all
  the pages are converted

The output is in Documentation/_build/man and the format is visually not
much different from what is generated by asciidoc.

Signed-off-by: David Sterba <dsterba@suse.com>
2021-10-29 17:30:03 +02:00
David Sterba 86d3904166 btrfs-progs: docs: add sphinx build support
Add basic config and build files for sphinx. The long term plan is to
convert all asciidoc sources to ReST and host majority of wiki contents,
and maybe more.

Build:

  $ cd Documentation/
  $ make -f Makefile.sphinx html

The result is in Documentation/_build/html.

Signed-off-by: David Sterba <dsterba@suse.com>
2021-10-29 17:30:03 +02:00
David Sterba 65181c273e btrfs-progs: mkfs: don't autoselect DUP on SSD for metadata anymore
The original idea of not doing DUP on SSD was that the duplicate blocks
get deduplicated again by the driver firmware. This was in 2013, years
ago. Then it was speculative and even nowadays we don't have much
reliable information from vendors what optimizations are done on the
drive level.

After the year there's enough information gathered by user community and
there's no simple answer. Expensive drives are more reliable but less
common, for cheap consumer drive it's vice versa. The characteristics
are described in more detail in manual page btrfs(5) in section "SOLID
STATE DRIVES (SSD)".

The reasoning is based on numerous reports on IRC and technical
difficulty on mkfs side to do the right decision. The default is chosen
to be the safe option and up to user to change that based on informed
decision.

Issue: #319
Signed-off-by: David Sterba <dsterba@suse.com>
2021-10-08 20:47:03 +02:00
David Sterba 72260bc3b9 btrfs-progs: mkfs: enable space_cache=v2 (free-space-tree) by default
The free space tree is a better way to track the free space and has been
tested in the wild for a long time. The backward compatibility is
sufficient, several long term kernels. On-line conversion from v1 to v2
can be done by mount, switching from v2 to v1 can be done by 'btrfs
check'.

Issue: #295
Signed-off-by: David Sterba <dsterba@suse.com>
2021-10-08 20:47:03 +02:00
David Sterba 1f918def34 btrfs-progs: mkfs: enable NO_HOLES by default
The no-holes feature reduces consumption of metadata by not representing
file holes. Reducing metadata is a good thing in general, this is the
main goal to enable this by default.

There's a drawback, related to the missing information about holes. The
'check' tool cannot use it to cross-reference extent information and in
some cases may not be able to detect a problem.

The no-hole feature can be also enabled by 'btrfstune -n' on an
unmounted filesystem.

Issue: #405
Signed-off-by: David Sterba <dsterba@suse.com>
2021-10-08 20:47:02 +02:00
David Sterba 0a4f9b93ab btrfs-progs: docs: subvolume ro->rw and incremental send
Signed-off-by: David Sterba <dsterba@suse.com>
2021-10-07 18:40:30 +02:00
David Sterba 332c193c47 btrfs-progs: prop set: add force parameter
Add option support to force the value change. This allows to do safety
checks by default and warn user that something might break. Using the
force will override that and changing the property should do change
itself and additionally any other changes that could break some
use cases.

Signed-off-by: David Sterba <dsterba@suse.com>
2021-10-07 18:40:24 +02:00
David Sterba 2814ec6b1f btrfs-progs: mkfs: add option -v/--verbose
The default output of mkfs is intentionally verbose so we did not need
the verbosity option. For some additional information it could be useful
to increase the level in case it's wired to the global verbosity
settings.

Signed-off-by: David Sterba <dsterba@suse.com>
2021-10-06 16:49:39 +02:00
David Sterba 2d50b98189 btrfs-progs: replace start: add option -K/--nodiscard
The commands initializing a new device (mkfs, device add) do discard by
default, while this is missing from replace start. For parity add the
options with same name and semantics.

Issue: #390
Signed-off-by: David Sterba <dsterba@suse.com>
2021-10-06 16:49:35 +02:00
David Sterba a177ef7dd4 btrfs-progs: mkfs: allow degenerate raid0/raid10
Kernel patch b2f78e88052bc0bee ("btrfs: allow degenerate raid0/raid10")
in
5.15 will allow mounting and converting to single device raid0 or two
device raid10.  Let mkfs create such filesystem.

"The motivation is to allow to preserve the profile type as long as it
 possible for some intermediate state (device removal, conversion), or
 when there are disks of different size, with raid0 the otherwise
 unusable space of the last device will be used too.  Similarly for
 raid10, though the two largest devices would need to be the same."

Signed-off-by: David Sterba <dsterba@suse.com>
2021-08-27 15:40:53 +02:00
David Sterba 6ea4830f8f btrfs-progs: build: add configure time option to enable experimental features
Add --enable-experimental configure option that allows to merge unstable
features or partially implemented features. This is supposed to help
features that need time to settle, tweak output or formatting and would
require constant rebases and would have limited exposure to users that
could provide feedback.

If this is enabled, the following may change without notice:

- the whole feature may disappear in the future
- new command names could change or relocate to other subcommands
- parameter names
- output formatting
- json output

Signed-off-by: David Sterba <dsterba@suse.com>
2021-08-25 15:38:53 +02:00
David Sterba bcae45d9e6 btrfs-progs: convert: new option to copy or specify uuid
Add new option --uuid to convert with the following modes:

- 'copy' -- copy the UUID from the source filesystem
- 'new' -- (default) generate new UUID
- UUID -- a valid UUID that will be set on btrfs

Based on patch from Florian

https://lore.kernel.org/linux-btrfs/1357486331-4615-2-git-send-email-falbrechtskirchinger@gmail.com/

and ported to contemporary codebase.

Issue: #391
Signed-off-by: David Sterba <dsterba@suse.com>
2021-08-20 14:24:55 +02:00
Qu Wenruo 42566a50ec btrfs-progs: docs: fix the out-of-date comment about free space tree support
Since v4.19, btrfs-progs has full write support to free space tree, the
out-of-date warning in btrfs(5) has already confused some end user.

Update the content to avoid further confusion.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2021-07-22 16:00:10 +02:00
David Sterba dcb2ebd6ab btrfs-progs: docs: more hw considerations
Add section about NVME and hints what to do to some other sections.  The
rest are typo or style fixes.

Signed-off-by: David Sterba <dsterba@suse.com>
2021-07-07 20:45:45 +02:00
David Sterba 78501931de btrfs-progs: docs: more about hardware considerations
Make it a new chapter with sections. The SSD and firmware parts were
inspired by a more detailed Zygo's writeup at
https://github.com/kdave/btrfs-progs/issues/319#issuecomment-739423260

Signed-off-by: David Sterba <dsterba@suse.com>
2021-07-02 17:27:53 +02:00
David Sterba 5ffbbcedb1 btrfs-progs: docs: document zone device stats
Signed-off-by: David Sterba <dsterba@suse.com>
2021-07-02 17:27:53 +02:00
David Sterba 0a020ba2d9 btrfs-progs: docs: note about loading accelerated sha256
If there's CONFIG_CRYPTO_SHA256=y in /proc/config.gz and no line with
'sha256' in /proc/modules, then the mount will use the generic
implementation.

After 'modprobe sha256' there's 'sha256_ssse3' in /proc/modules and the
sysfs checksum file would show e.g. 'sha256-avx2'.

Signed-off-by: David Sterba <dsterba@suse.com>
2021-07-02 17:27:53 +02:00
Hugo Mills 373def57ce btrfs-progs: docs: minor fixes for spelling and idiom
Author: Hugo Mills <hugo@carfax.org.uk>
Signed-off-by: David Sterba <dsterba@suse.com>
2021-07-02 17:27:53 +02:00
David Sterba 9b027ac64e btrfs-progs: docs: add section about hardware considerations
Signed-off-by: David Sterba <dsterba@suse.com>
2021-07-02 17:27:53 +02:00
David Sterba cb11769cd3 btrfs-progs: docs: write section about storage model
Signed-off-by: David Sterba <dsterba@suse.com>
2021-07-02 17:27:52 +02:00
David Sterba 63794e7016 btrfs-progs: docs: update device related info
- recently added stripe count in device usage
- other minor updates

Signed-off-by: David Sterba <dsterba@suse.com>
2021-07-02 17:27:52 +02:00
David Sterba 6710641ad5 btrfs-progs: docs: add section about zoned devices
Signed-off-by: David Sterba <dsterba@suse.com>
2021-07-02 17:27:52 +02:00
David Sterba c3acaee63a btrfs-progs: docs: add more results for checksums
Update the table with AVX2 accelerated versions provided by libgcrypt
and libsodium.

Signed-off-by: David Sterba <dsterba@suse.com>
2021-06-23 13:47:35 +02:00
David Sterba ae59e39531 btrfs-progs: docs: add section about compression
Signed-off-by: David Sterba <dsterba@suse.com>
2021-06-23 13:47:35 +02:00
David Sterba 1eb7b11303 btrfs-progs: remove stale user transaction ioctl definitions
The user transaction ioctls have been removed in kernel 4.17 by commit
7a5a07a81062 ("btrfs: Remove userspace transaction ioctls"), the
definitions are not relevant and can be removed.

The numbers could be reused in the future, eg. when there are no
maintained LTS kernels older than 4.19.

Signed-off-by: David Sterba <dsterba@suse.com>
2021-06-19 22:07:50 +02:00
David Sterba 9f6c055e38 btrfs-progs: dump-tree: add options to dump checksums
Add new options to dumps checksums in node headers and in the checksum
items:

  $ btrfs inspect dump-tree --csum-headers image
  root tree
  leaf 471515136 items 19 free space 12186 generation 15 owner ROOT_TREE
  leaf 471515136 flags 0x1(WRITTEN) backref revision 1 csum 0x756b2d54
  fs uuid df0348df-5773-47dd-81e9-a18221461239

For nodes/leaves it's appended on the 2nd line of the header.

Checksum items are stored in leaves as EXTENT_CSUM key type, with offset
value as the logical offset starting. As the array would be hard to
parse or match, each offset value is printed with the checksum. For
crc32c it's 4 values on a line, for xxhash it's 2 and for the long
256bit checksums it's one checksum per line.

  $ btrfs inspect dump-tree --csum-items image
  leaf 5423104 items 1 free space 30 generation 6 owner CSUM_TREE
  leaf 5423104 flags 0x1(WRITTEN) backref revision 1
  fs uuid bd7c981e-16ff-4081-a734-3ef5d50cafc1
  chunk uuid 13f4c76c-7845-4984-88ed-f01b52e05cf8
	  item 0 key (EXTENT_CSUM EXTENT_CSUM 22020096) itemoff 55 itemsize 16228
		  range start 22020096 end 38637568 length 16617472
		  [22020096] 0x8941f998 [22024192] 0x8941f998 [22028288] 0x8941f998 [22032384] 0x8941f998
		  [22036480] 0x8941f998 [22040576] 0x8941f998 [22044672] 0x8941f998 [22048768] 0x8941f998
		  ...

  $ btrfs inspect dump-tree --csum-items image
  leaf 5718016 items 1 free space 7746 generation 6 owner CSUM_TREE
  leaf 5718016 flags 0x1(WRITTEN) backref revision 1
  fs uuid f453a5b4-8b4a-4fbf-90a2-2925e4fe2335
  chunk uuid eb1da63b-248b-44c2-82da-71b2564bf50e
	  item 0 key (EXTENT_CSUM EXTENT_CSUM 52387840) itemoff 7771 itemsize 8512
		  range start 52387840 end 53477376 length 1089536
		  [52387840] 0x686ede9288c391e7e05026e56f2f91bfd879987a040ea98445dabc76f55b8e5f
		  [52391936] 0x686ede9288c391e7e05026e56f2f91bfd879987a040ea98445dabc76f55b8e5f
		  ...

The options are not on by default, the header checksum is not important
for the structures. Data checksums can be quite big so that would make
the dump long and without any actual data to match against.

Signed-off-by: David Sterba <dsterba@suse.com>
2021-06-19 22:07:49 +02:00
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
Alexandru Ungureanu 378a1ab8ff btrfs-progs: docs: improved asciidoc syntax to fix rendering issues
This example in device replace doesn't render properly in browsers,
think it's just misuse of syntax. Unfortunately, the github preview
renderer doesn't seem to catch that. Otherwise, manual page and html
rendering is ok.

The syntax uses Example delimited block:

.Heading
====
contents
====

Pull-request: #245
Author: Alexandru Ungureanu <khakcarot@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2020-05-04 20:48:52 +02:00
Goffredo Baroncelli 24dcafc491 btrfs-progs: docs: add section about multiple profiles
Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it>
Signed-off-by: David Sterba <dsterba@suse.com>
2020-05-04 20:48:35 +02:00
Adam Borowski 3d379b1341 btrfs-progs: lots of typo fixes (codespell)
Signed-off-by: Adam Borowski <kilobyte@angband.pl>
Signed-off-by: David Sterba <dsterba@suse.com>
2020-03-31 18:37:38 +02:00
David Sterba d028b3998e btrfs-progs: dump-tree: rename to option to --hide-names
Previously, no filenames/xattrs would be printed with --nofilename, but
to keep the format of dump, print a placeholder instead of all names.
This is:

* directory entries (files, directories, subvolumes)
* default subvolume
* extended attributes (name, value)
* hardlink names if stored inside another item

Note that lengths are not hidden because they can be calculated from the
item size anyway.

Signed-off-by: David Sterba <dsterba@suse.com>
2020-03-20 22:05:27 +01:00
Qu Wenruo 4d4e7d7c9f btrfs-progs: dump-tree: Introduce --nofilename option
In the mail list, it's pretty common that a developer is asking dump tree
output from the reporter, it's better to protect those kind reporters by
hiding the filename if the reporter wants.

This option will skip @name/@data output for the following items:
- DIR_INDEX
- DIR_ITEM
- INODE_REF

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2020-03-20 22:05:26 +01:00
David Sterba 3babb783ab btrfs-progs: docs: dump-tree, fix formatting of --dfs/--bfs
Description that's not one paragraph needs to be joned to the following
section with +.

Signed-off-by: David Sterba <dsterba@suse.com>
2020-03-20 22:05:26 +01:00
Michael Lass 8d03e630e9 btrfs-progs: qgroup: allow passing options to qgroup remove
According to the documentation, btrfs qgroup remove takes the same
options as qgroup assign, i.e., --rescan and --no-rescan. However,
currently no options are accepted. Activate option handling also for
qgroup remove, so that automatic rescan can be disabled by the user.

Signed-off-by: Michael Lass <bevan@bi-co.net>
Signed-off-by: David Sterba <dsterba@suse.com>
2020-03-20 22:05:25 +01:00
Marcos Paulo de Souza 6e85994e80 btrfs-progs: subvol delete: add --subvolid argument to deletee by id
This ioctl will be responsible for deleting a subvolume using its id.
This can be used when a system has a file system mounted from a
subvolume, rather than the root file system, like below:

/
@subvol1/
@subvol2/
@subvol_default/

If only @subvol_default is mounted, we have no path to reach @subvol1
(id 256) and @subvol2 (id 257), thus no way to delete them. Current
subvolume delete ioctl takes a file handle point as argument, and if
@subvol_default is mounted, we can't reach @subvol1 and @subvol2 from
the same mount point.

  $ mount -o subvol=subvol_default /mnt
  $ btrfs subvolume delete -i 257 /mnt

This will delete @subvol2 although it's path is hidden.

Fixes: #152
Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2020-03-04 19:21:09 +01:00
Stefan 4e21389c0c btrfs-progs: docs: fix minor typos
Pull-request: #235
Author: Stefan <stefan.haubenthal@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2020-03-03 19:58:55 +01:00
David Sterba 015402b847 btrfs-progs: docs: clarify filesystem sync and subvolume cleaning
Qu reported that the 'fi sync' should be clarified regarding the
subvolume cleaning. Update the paragraph as sugested by Graham.

Link: https://lore.kernel.org/linux-btrfs/20200210090201.29979-1-wqu@suse.com
Signed-off-by: David Sterba <dsterba@suse.com>
2020-03-03 19:58:54 +01:00
David Sterba 7e26b93932 btrfs-progs: docs: update scrub
Clarify status file updates after cancel, io schedulers.

Signed-off-by: David Sterba <dsterba@suse.com>
2020-03-03 19:58:53 +01:00
Zygo Blaxell 3c5254b187 btrfs-progs: inspect-internal: document new logical-resolve options and kernel requirements
Document the new options requiring the V2 ioctl and the increased
default buffer size.

Signed-off-by: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2020-03-03 19:58:53 +01:00
A. Wilcox 2a064d77a7 btrfs-progs: docs: Don't erase XMLTO_EXTRA contents, fix docbook5 build
XMLTO_EXTRA is defined above, and then appended to if `asciidoctor` is
used to generate the manual pages.  The second definition was clearing
the value of this variable, which caused builds with asciidoctor to
fail with:

```
    [XMLTO]  btrfs-ioctl.3
xmlto: /usr/src/packages/user/btrfs-progs/src/btrfs-progs-v5.4/Documentation/btrfs-ioctl.xml does not validate (status 3)
xmlto: Fix document syntax or use --skip-validation option
validity error : no DTD found!
Document /usr/src/packages/user/btrfs-progs/src/btrfs-progs-v5.4/Documentation/btrfs-ioctl.xml does not validate
make[1]: *** [Makefile:114: btrfs-ioctl.3] Error 13
```

Fixes: 669f56177 ("btrfs-progs: docs: use docbook5 backend for asciidoctor")
Signed-off-by: A. Wilcox <AWilcox@Wilcox-Tech.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2020-01-09 14:28:52 +01:00
Alexandru Ungureanu 329a5bba15 btrfs-progs: docs: add example for replacing an online drive
Added example for replacing an online drive in a healthy with a bigger
one.

Pull-request: #217
Author: Alexandru Ungureanu <khakcarot@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2019-11-22 19:09:52 +01:00
Marcos Paulo de Souza 50ec684a20 btrfs-progs: docs: clarify the default list sort order of subvolumes
By default, "btrfs subvolume list" will show the subvolumes sorted by
subovlume id, in ascending order. Make this explicit in subvolume manual
page.

Pull-request: #220
Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2019-11-22 19:09:51 +01:00
David Sterba 899977cd18 btrfs-progs: docs: update mkfs blockgroup description
- add raid1c34
- add utilization to the overview table
- wording updates

Signed-off-by: David Sterba <dsterba@suse.com>
2019-11-22 19:09:51 +01:00
David Sterba a85c496c0d btrfs-progs: docs: update check modes
Signed-off-by: David Sterba <dsterba@suse.com>
2019-11-22 19:07:21 +01:00
David Sterba a999abb7e9 btrfs-progs: docs: document new --repair --force behaviour
Signed-off-by: David Sterba <dsterba@suse.com>
2019-11-22 19:07:20 +01:00
David Sterba a517225ece btrfs-progs: docs: checksum algorithms
Signed-off-by: David Sterba <dsterba@suse.com>
2019-11-22 19:07:20 +01:00
David Sterba c981414ea3 btrfs-progs: docs: switch btrfs(5) to auto-numbered list
Each new chapter needed renumbering the whole list, this can be avoided.

Signed-off-by: David Sterba <dsterba@suse.com>
2019-11-22 19:07:20 +01:00
David Sterba c1a1aa9e33 btrfs-progs: docs: document checksum options for mkfs and convert
Signed-off-by: David Sterba <dsterba@suse.com>
2019-11-22 19:07:20 +01:00
Merlin Büge 99d6346048 btrfs-progs: small fixes/cleanup in Documentation
The removed paragraph in btrfs-man5.asciidoc says the same as the
previous one.

Signed-off-by: Merlin Büge <merlin.buege@tuhh.de>
Signed-off-by: David Sterba <dsterba@suse.com>
2019-11-18 19:21:06 +01:00
Dennis Zhou 483179bbae btrfs-progs: docs: add compression level support for mount options
As of 5.1, btrfs now supports compression levels for zstd. Let users
know about this in the man page.

Pull-request: #204
Signed-off-by: Dennis Zhou <dennis@kernel.org>
Signed-off-by: David Sterba <dsterba@suse.com>
2019-10-14 17:29:44 +02:00
Dimitri John Ledkov 669f561775 btrfs-progs: docs: use docbook5 backend for asciidoctor
Switch backend to docbook5 for asciidoctor and disable validation as v5
does not use DTBs.

Pull-request: #203
Issue: #201
Signed-off-by: Dimitri John Ledkov <xnox@ubuntu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2019-10-14 17:28:09 +02:00
Vladimir Panteleev ed2b4dc638 btrfs-progs: docs: document btrfs-balance exit status in detail
Signed-off-by: Vladimir Panteleev <git@vladimir.panteleev.md>
Signed-off-by: David Sterba <dsterba@suse.com>
2019-10-14 17:27:44 +02:00
David Sterba f55bdde2f9 btrfs-progs: dump-tree: update help and docs regarding DFS/BFS
The default traversal has been switched to BFS due, update the
documentation accordingly. Also fix the help text of the command that
ommitted to mention the options.

Signed-off-by: David Sterba <dsterba@suse.com>
2019-10-14 17:27:31 +02:00
Hans van Kranenburg e46e17ab5a btrfs-progs: docs: fix label property description
Recently, commit c9da5695b2 improved the description for the label
property, to clarify it's a filesystem property, and not a device
property. Follow this change in the man page for btrfs-property.

Also add a little hint about what to specify as object.

Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Hans van Kranenburg <hans.van.kranenburg@mendix.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2019-09-04 16:06:36 +02:00
David Sterba b4cadc2ac9 btrfs-progs: docs: fix formatting of btrfs(5)
Two paragraphs for 'discard' mount option were not aligned in the
section and the swapfile bullet list was squashed to one line. All in
the manual page output.

Signed-off-by: David Sterba <dsterba@suse.com>
2019-09-04 16:06:33 +02:00
Anand Jain 03241303eb btrfs-progs: dump-tree: add noscan option
The comman 'btrfs inspect dump-tree <dev>' will scan all the devices
from the filesystem by defaul.

So as of now you can not inspect each mirrored device independently.

This patch adds option --noscan, which when used won't scan the system
for the partner devices, instead it just uses the devices provided in
the argument.

For example:
  btrfs inspect dump-tree --noscan <dev> [<dev>..]

This helps to debug degraded raid1 and raid10.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2019-07-04 15:36:00 +02:00
David Sterba 4c70b84aba btrfs-progs: document the new all-in-one binary
Signed-off-by: David Sterba <dsterba@suse.com>
2019-07-04 15:36:00 +02:00
David Sterba 8d3da70b36 btrfs-progs: docs: update fi du regarding recursion
State that 'fi du' does descend to subvolumes.

Issue: #185
Signed-off-by: David Sterba <dsterba@suse.com>
2019-07-04 02:06:35 +02:00
David Sterba 534c296121 btrfs-progs: docs: update defrag regarding recursion
State that defrag by default does not descend to subvolumes, this has
been hidden in implementation details.

Issue: #185
Signed-off-by: David Sterba <dsterba@suse.com>
2019-07-04 02:06:35 +02:00
David Sterba 88f4bcb351 btrfs-progs: test: add simple test for defrag recursion depth
The documentation lacks clarity about depth to which recursive
defragmentation go, and was pointed out by a user.

The problem here is that the subvolume behaves the same as mount point
regarding path traversal. The nftw stops on mount boundary (FTW_MOUNT).

Add test that verifies this behaviour. Defrag has to be updated to allow
descending to subvolumes (and not mountpoints).

Issue: #185
Signed-off-by: David Sterba <dsterba@suse.com>
2019-07-04 02:06:35 +02:00
David Sterba 6645837afd btrfs-progs: docs: add reference of section 5 page
The page from section 5 is in the text, make it more visible and add it
to the references too.

Signed-off-by: David Sterba <dsterba@suse.com>
2019-07-03 13:31:14 +02:00
Qu Wenruo f312aff23f btrfs-progs: inspect-dump-tree: Allow --block to be specified multiple times
Reuse extent-cache facility to record multiple bytenr so --block can be
specified multiple times.

Despite that, add a sector size alignment check before we try to print a
tree block.  Please note that, nodesize alignment check is not suitable
here as meta chunk start bytenr could be unaligned to nodesize.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2019-03-05 15:58:06 +01:00
Steven Davies 33b4acc7df btrfs-progs: receive: add option for quiet mode
Provide an option in `btrfs receive` to suppress the informational
messages when writing files.

Signed-off-by: Steven Davies <btrfs@steev.me.uk>
Signed-off-by: David Sterba <dsterba@suse.com>
2019-03-05 15:33:54 +01:00
David Sterba cec1472792 btrfs-progs: docs: add scan --forget
Signed-off-by: David Sterba <dsterba@suse.com>
2019-03-01 16:49:53 +01:00
David Sterba 111f1473bd btrfs-progs: docs: document btrfstune -m/-M
Signed-off-by: David Sterba <dsterba@suse.com>
2019-01-17 00:52:09 +01:00
David Sterba 45c2b3bb89 btrfs-progs: docs: btrfstune: sort options alphabetically
Signed-off-by: David Sterba <dsterba@suse.com>
2019-01-17 00:34:10 +01:00
Andrea Gelmini c8d3986ed7 btrfs-progs: docs: update scrub docs
Enhance the note what scrub does not compared to 'check'.

Author: Andrea Gelmini <andrea.gelmini@gelma.net>
Signed-off-by: David Sterba <dsterba@suse.com>
2019-01-15 18:56:04 +01:00
David Sterba 5c880c82c2 btrfs-progs: docs: add swapfile support description to sect. 5
Signed-off-by: David Sterba <dsterba@suse.com>
2019-01-15 18:42:14 +01:00
David Sterba 5121b09519 btrfs-progs: docs: update system limits texts in sect. 5
Signed-off-by: David Sterba <dsterba@suse.com>
2019-01-15 18:42:13 +01:00
David Sterba 428bb2e9c2 btrfs-progs: docs: add metadata_uuid description to sect. 5
Signed-off-by: David Sterba <dsterba@suse.com>
2019-01-15 18:42:13 +01:00
David Sterba 71ba47d26e btrfs-progs: docs: add bootloader support to section 5
Add the section with brief summary of the support. The supported
features could be mentioned explicitly with versions, and other examples
of "check before use" that could lead to unbootable systems.

Signed-off-by: David Sterba <dsterba@suse.com>
2019-01-15 18:42:13 +01:00
David Sterba 1bff5b8261 btrfs-progs: docs: enhance subvol show documentation and help
There's a suggestion in #158 to improve the documenatation of the subvol
show command so it's more obvious what kind of information it provides.

I've updated the docs according to that and added an example that should
make the request for creation time at least greppable, the overall
description mentions 'times' so this should be enough as a pointer.

Pull-request: #158
Suggested-by: Robert Pollak <robert.pollak@posteo.net>
Signed-off-by: David Sterba <dsterba@suse.com>
2019-01-15 18:42:13 +01:00
David Disseldorp a4a6e51047 btrfs-progs: docs: fix balance -f grammar
Signed-off-by: David Disseldorp <ddiss@suse.de>
Signed-off-by: David Sterba <dsterba@suse.com>
2019-01-15 18:42:12 +01:00
Josh Soref f0cdb2c9fb btrfs-progs: docs: fix typos in Documentation
Generated by https://github.com/jsoref/spelling

Issue: #154
Author: Josh Soref <jsoref@users.noreply.github.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2018-11-26 17:32:10 +01:00
David Sterba 5d64c40240 btrfs-progs: docs: fix rendering of exponents in manual pages
Reported on IRC that the inode number limit appears to be 264, while the
actual value is 2^64. Fix that for the manual page backend by redefining
the format.

Signed-off-by: David Sterba <dsterba@suse.com>
2018-11-20 11:16:02 +01:00
Qu Wenruo 325256a232 btrfs-progs: doc: Update btrfs-qgroup regarding the rescan conditions
Add a new section, QUOTA RESCAN, to explain why and when we need a full
quota rescan when assigning/removing qgroup relationship.

Also, since 'remove' shares the same options of 'assign', add reference
to 'assign' options for 'remove' subcommand.

Signed-off-by: Qu Wenruo <wqu@suse.com>
[ update ]
Signed-off-by: David Sterba <dsterba@suse.com>
2018-10-31 18:24:14 +01:00
Qu Wenruo dda84b8a16 btrfs-progs: qgroup: make --rescan the default behavior after assign
Even though we have --rescan option, it still needs the user to manually
specify it or call quota rescan command.

This does not make much sense for the most common usecase and only
confuses users.  When the rescan is not desired, the --no-rescan option
can be used, eg.  when a mass qgruop assignment happens and the repeated
rescan would slow things down. This is considered a marginal usecase.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2018-10-31 18:24:14 +01:00
Qu Wenruo 0bbd407cbb btrfs-progs: print-tree: Introduce --bfs and --dfs options
Originally print-tree uses depth first search to print trees.
This works fine until we reach 3 level trees (root node level is 2).

For tall trees whose root level is 2 or higher, DFS will mix nodes and
leaves like the following example:

Level 2                       A
                             / \
Level 1                     B   C
                          / |   | \
Level 0                  D  E   F  G

DFS will cause the following output sequence:
A   B   D   E   C   F   G
Which in term of node/leave is:
N   N   L   L   N   L   L

Such mixed node/leave result is sometimes hard for human to read.

This patch will introduce 2 new options, --bfs and --dfs.

  --dfs: keeps the original output sequence, and to keep things
         compatible it's the default behavior.

  --bfs: uses breadth-first search, and will cause better output
         sequence like:

	 A   B   C   D   E   F   G
	 Which in term of node/leave is:
	 N   N   N   L   L   L   L

Much better sorted and may become default in the future.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2018-10-31 18:24:14 +01:00
Misono Tomohiro 47abaaf6d0 btrfs-progs: doc: update manual page of btrfs subvolume
Some information is obsolete and updated as follows:

 - add missing explanations of some options
 - remove outdated explanation of "subvolrootid" mount option
 - reorder/group options of "subvolume list" so it matches the  help
   message
 - add explanation of different meanings of parent in "parent ID/UUID"
 - fix indentation/spelling
 - add missing comma

Signed-off-by: Misono Tomohiro <misono.tomohiro@jp.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2018-10-31 18:24:14 +01:00
David Sterba 51074d2f78 btrfs-progs: docs: update clean target file masks
There's a regular manual page that matches the file glob mask *.8 so we
have to be more careful and remove only the known intermediate files.

Signed-off-by: David Sterba <dsterba@suse.com>
2018-10-23 14:48:39 +02:00
David Sterba 678d6c9c0f btrfs-progs: build: remove gzip dependency
The manual pages are not compressed anymore and we can remove gzip from
build dependencies and build steps.

Signed-off-by: David Sterba <dsterba@suse.com>
2018-10-23 14:48:39 +02:00
Mike Gilbert 14357b3e34 btrfs-progs: docs: install uncompressed manual pages
Build systems do not typically compress man pages when installing them.
This is generally left to distro packaging mechanisms, which may end up
recompressing them using a different compressor.

Author: Mike Gilbert <floppym@gentoo.org>
Signed-off-by: David Sterba <dsterba@suse.com>
2018-10-23 14:48:39 +02:00
David Sterba c0bf61709b btrfs-progs: docs: use manual page link instead of symlink
In order to install uncompressed manual pages we can't use the symlink
for the deprecated btrfsck page. Replace it by source command provided
by the manual page format.

Old: man8/btrfsck.8.gz (symlink)
New: man8/btrfsck.8 (file)

Reported-by: Mike Gilbert <floppym@gentoo.org>
Signed-off-by: David Sterba <dsterba@suse.com>
2018-10-23 14:48:39 +02:00
Su Yue 3894560deb btrfs-progs: docs: update document about option -R of btrfs-scrub
The option '-R' of btrfs-scrub was documented by mistake as
'print raw statistics per-device instead of a summary'.

Here change it to 'raw print mode, print full data instead of
summary' which it works actually.

Fixes: 162257574a ("btrfs-progs: docs: update btrfs-scrub")
Reported-by: Chris Murphy <chris@colorremedies.com>
Signed-off-by: Su Yue <suy.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2018-10-23 14:48:38 +02:00
Misono Tomohiro c722bb24f8 btrfs-progs: doc: Update man 5 btrfs for 4.18
Update the information to reflect the status of 4.18

Main Updates:

- Add explanation of improved compression heuristic algorithm
- Add explanation that norecovery == nologreplay
- Add explanation of nossd_spread mount option
- Add explanation of rmdir_subovl feature

Signed-off-by: Misono Tomohiro <misono.tomohiro@jp.fujitsu.com>
[ minor updates ]
Signed-off-by: David Sterba <dsterba@suse.com>
2018-08-06 15:01:26 +02:00
Nikolay Borisov 5a87a95115 btrfs-progs: Remove deprecated btrfs-show-super
Its function has been superseded by btrfs inspect-internal show-super.
Furthermore the tools is currently not built by default. Just remove it.

Deprecated since 4.8.

Issue: #97
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2018-04-24 13:00:10 +02:00
Nikolay Borisov df9158f20d btrfs-progs: Remove deprecated btrfs-zero-log standalone tool
Its function has been subsumed by "btrfs rescue zero-log". Remove its
source file and adjust make/tests soruces accordingly.

Deprecated since 4.0.

Issue: #97
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2018-04-24 13:00:10 +02:00
Nikolay Borisov de34a33a82 btrfs-progs: Remove btrfs-debug-tree command
There is already a replacement in the face of btrfs inspect-internal
dump-tree. And this command is just a simple wrapper around it. Just
remove it and adjust the show-blocks script to call the main btrfs
binary to achieve the same effect.

Informally deprecated since 4.4.

Issue: #97
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2018-04-24 13:00:10 +02:00
David Sterba d0aafc51e4 btrfs-progs: docs: fix typos
A few more typo fixes, merged with the pull request.

Pull-request: #120
Signed-off-by: Gu Jinxiang <gujx@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2018-03-31 00:13:23 +02:00
Qu Wenruo 992aa55839 btrfs-progs: dump-tree: add option to print children nodes of a given block
When debuging with "btrfs inspect dump-tree", it's not that handy if we
want to iterate all child tree blocks starting from a specified block.

-b can only print a single block, while without -b "btrfs inspect dump-tree"
will need extra tree roots fulfilled to continue, which is not possible
for a damaged filesystem.

Add a new option --follow to iterate a sub-tree starting from block
specified by --block.

Signed-off-by: Qu Wenruo <wqu@suse.com>
[ remove the short option for now ]
Signed-off-by: David Sterba <dsterba@suse.com>
2018-03-30 22:15:54 +02:00
Nicholas D Steeves 0dc758d89e btrfs-progs: Fix typos in docs and user-facing strings
Signed-off-by: Nicholas D Steeves <nsteeves@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2018-03-30 22:15:54 +02:00
David Sterba fd5767a574 btrfs-progs: docs: add section about filesystem limits to btrfs(5)
Signed-off-by: David Sterba <dsterba@suse.com>
2018-03-30 22:15:53 +02:00
David Sterba 652544f4c0 btrfs-progs: build: add support for asciidoctor doc generator
We've been using asciidoc that's written in python2, which is going to
be phased out and deprecated next year. There's a replacement,
asciidoctor. Add a configure-time detection which tool is available,
update Documentation/Makefile.in.

The original asciidoc tool is still preferred as it produces slightly
better output. The file asciidoc.conf does not have a direct equivalten
in asciidoct and would need to be replaced by extension written in ruby.

The differences:

- the <literal> are not automatically underlined and are less visible in
  the generated manual page, but it's still acceptable
- the inline CSS for the html output looks subjectively worse, is less
  compact and colourful

Issue: #89
Signed-off-by: David Sterba <dsterba@suse.com>
2018-02-02 21:02:13 +01:00
David Sterba 4523dc2776 btrfs-progs: docs: fix manual page title format
Asciidoctor is more strict about the formatting for the manual pages and
needs exact number of =.

Signed-off-by: David Sterba <dsterba@suse.com>
2018-02-02 21:02:13 +01:00
William Giokas 93f1cf07f0 btrfs-progs: docs: fix typo in btrfs-filesystem manual page
Pull-request: #86
Signed-off-by: William Giokas <1007380@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2018-01-31 15:14:03 +01:00
David Sterba 30bce43dfd btrfs-progs: docs: clean all generated files
The section 3 manual page btrfs-ioctl was not deleted.

Signed-off-by: David Sterba <dsterba@suse.com>
2018-01-31 15:14:03 +01:00
David Sterba fab56e8c84 btrfs-progs: docs: update manual for mkfs --shrink
Signed-off-by: David Sterba <dsterba@suse.com>
2018-01-08 18:15:24 +01:00
Qu Wenruo 1c9c5f7fb3 btrfs-progs: mkfs: Separate shrink from rootdir
Make --shrink a separate option for --rootdir, and change the default to
off.

The shrinking behaviour is not a commonly used feature but can be useful
for creating minimal pre-filled images, in one step, without requiring
to mount.

Signed-off-by: Qu Wenruo <wqu@suse.com>
[ update changelog and error messages ]
Signed-off-by: David Sterba <dsterba@suse.com>
2018-01-08 18:15:15 +01:00
Nicholas D Steeves 8c5db79d0f btrfs-progs: docs: annual typo, clarity, & grammar review & fixups
Signed-off-by: Nicholas D Steeves <nsteeves@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2018-01-03 17:29:19 +01:00
Faalagorn 0a9ab87252 btrfs-progs: docs: fix typo in btrfs-man5
Pull-request: #81
Author: Faalagorn <faalagorn@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2018-01-03 17:29:19 +01:00
David Sterba 2d6f49ffaa btrfs-progs: docs: make option -A of mkfs less visible
The option will be removed in the future, move it to the end of the
list.

Signed-off-by: David Sterba <dsterba@suse.com>
2018-01-03 17:29:19 +01:00
Howard 4c09c15f46 btrfs-progs: docs: update btrfs-subvolume manual page
To simplify, I suggest moving the 'writable/readonly' issue only to the
-r line, instead of having it introduced in two places.

Pull-request: #80
Author: Howard <hwj@BridgeportContractor.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2018-01-03 17:09:35 +01:00
David Sterba 561e6da458 btrfs-progs: docs: move the rescue fix-device-size command and update
The subcommands are supposed to be in alphabetical order, move it to the
right spot and reword.

Signed-off-by: David Sterba <dsterba@suse.com>
2017-11-14 16:20:14 +01:00
David Sterba a0abb06218 btrfs-progs: docs: add note about mount option applicability
Copied from https://btrfs.wiki.kernel.org/index.php/Mount_options .

Signed-off-by: David Sterba <dsterba@suse.com>
2017-11-14 15:59:00 +01:00
David Sterba c9fa9355f3 btrfs-progs: docs: add impact of atime/noatime
Copy from wiki
https://btrfs.wiki.kernel.org/index.php?title=Mount_options

Signed-off-by: David Sterba <dsterba@suse.com>
2017-11-14 15:59:00 +01:00
David Sterba 94856dd547 btrfs-progs: docs: update mount options
Enhance the text, update for 4.14, sync with existing wiki page.

Signed-off-by: David Sterba <dsterba@suse.com>
2017-11-14 15:59:00 +01:00
Benjamin Peterson 3daa286951 btrfs-progs: docs: correct grammar
Signed-off-by: Benjamin Peterson <bp@benjamin.pe>
Signed-off-by: David Sterba <dsterba@suse.com>
2017-11-14 15:59:00 +01:00
Qu Wenruo 06f56db9cb btrfs-progs: rescue: Introduce fix-device-size
Introduce new subcommand 'fix-device-size' to the rescue group, to fix
device size alignment-related problems.

Especially for people unable to mount their fs with super::total_bytes
mismatch, this tool will fix the problems and let the mount continue.

Reported-by: Asif Youssuff <yoasif@gmail.com>
Reported-by: Rich Rauenzahn <rrauenza@gmail.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
2017-11-14 15:59:00 +01:00
Misono, Tomohiro 2192bd5cfc btrfs-progs: doc: add description of missing and example, of device remove
This patch updates help/document of "btrfs device remove" in two points:

1. Add explanation of 'missing' for 'device remove'. This is only
written in wikipage currently.
(https://btrfs.wiki.kernel.org/index.php/Using_Btrfs_with_Multiple_Devices)

2. Add example of device removal in the man document. This is because
that explanation of "remove" says "See the example section below", but
there is no example of removal currently.

Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com>
Reviewed-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
[ move "" from the macro to help strings ]
Signed-off-by: David Sterba <dsterba@suse.com>
2017-11-14 15:59:00 +01:00
David Sterba f25091e654 btrfs-progs: docs: update btrfs-properties
Signed-off-by: David Sterba <dsterba@suse.com>
2017-11-14 15:59:00 +01:00
David Sterba c0f7e29127 btrfs-progs: prop: also allow "none" to disable compression
Some people were asking why disabling compression via properties is not
set by "none" instead. As this is purely userspace conversion to "" that
kernel accepts, let's add "none" as well for convenience.

Signed-off-by: David Sterba <dsterba@suse.com>
2017-11-14 15:59:00 +01:00
Satoru Takeuchi df11e2787b btrfs-progs: allow "no" to disable compression for convenience
It's messy to use "" to disable compression. Introduce the new value "no"
which can also be used for this purpose.

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
[ coding style fixes ]
Signed-off-by: David Sterba <dsterba@suse.com>
2017-11-14 15:59:00 +01:00
Misono, Tomohiro 4a5b95abb6 btrfs-progs: subvol: change set-default to also accept path
This patch changes "subvol set-default" to also accept the subvolume path
for convenience.

If there are two args, they are assumed as subvol id and path to the fs
(the same as current behavior), and if there is only one arg, it is assumed
as the path to the subvolume.

subvol id is resolved by test_issubvolume() + lookup_path_rootid().
The empty subvol (ino == 2) will get error on test_issubvolume() which
checks whether inode num is 256 or not.

Issue: #35
Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com>
[ update documentation, use the new multi-line command scheme ]
Signed-off-by: David Sterba <dsterba@suse.com>
2017-11-14 15:59:00 +01:00
David Sterba f96546d01c btrfs-progs: docs: update btrfs-balance
Copy unexpected edits from wiki so they do not get lost at next
git->wiki sync.

Author: Bill S.
Signed-off-by: David Sterba <dsterba@suse.com>
2017-10-06 13:41:12 +02:00
David Sterba bc2c60ad31 btrfs-progs: docs: start ioctl documentation manual page
Start documenting the ioctl interface to btrfs. The overall structure
should be settled, the formatting of the ioctl description may change in
the future, newly added ioctl descriptions should follow the examples of
BTRFS_IOC_SUBVOL_CREATE.

The document is not finished yet and will not be installed until most of
ioctls' details are filled in.

Signed-off-by: David Sterba <dsterba@suse.com>
2017-09-25 15:18:09 +02:00
Nick Terrell 717a8b1e5d btrfs-progs: Add zstd support
Adds zstd support to the btrfs program. An optional dependency on libzstd
>= 1.0.0 is added. Autoconf accepts `--enable-zstd' or `--disable-zstd' and
defaults to detecting if libzstd is present using `pkg-config'.

The patch is also available in my fork of btrfs-progs [1], which passes
Travis-CI with the new tests. The prebuilt binary is available there.

I haven't updated Android.mk.

[1] https://github.com/terrelln/btrfs-progs/tree/devel

Signed-off-by: Nick Terrell <terrelln@fb.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2017-09-25 15:17:13 +02:00
David Sterba 162fdf9538 btrfs-progs: check: add option to skip mount checks
Sometimes it's needed to do a check on a mounted filesystem. This should
work fine on a quiescent filesystem or a read-only mount. Changes on the
block device done by kernel might confuse the userspace checker and it
might crash when it reads some stale data.

Repair without mount checks is not supported right now.

Signed-off-by: David Sterba <dsterba@suse.cz>
2017-09-08 16:15:05 +02:00
David Sterba ebf449b521 btrfs-progs: docs: update btrfs-convert regarding reiserfs
Signed-off-by: David Sterba <dsterba@suse.com>
2017-09-08 16:15:05 +02:00
Misono, Tomohiro 4daf0d52f8 btrfs-progs: docs: add figure 1 to btrfs quota doc
The document of btrfs quota is missing figure 1.

I notice the body is copy of http://sensille.com/qgroups.pdf (which is
linked from https://btrfs.wiki.kernel.org/index.php/Quota_support), and
insert the figure.

Signed-off-by: David Sterba <dsterba@suse.com>
2017-08-24 19:45:55 +02:00
Misono, Tomohiro 031ea0083a btrfs-progs: docs: add missing short option for qroup-report
Usage info of "btrfs check" shows "-Q|--qgroup-report" (and first patch
enables -Q), but the document only shows "--qgroup-report".

Therefore add -Q to the doc.

Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2017-08-24 19:17:43 +02:00
Qu Wenruo f65b6b156f btrfs-progs: Doc: Fix asciidoc grammar of btrfs-rescue
Code block of kernel backtrace lacks leading change line, causing the
following man page result:
------
           One can determine whether zero-log is needed according to the
           kernel backtrace:

           ? replay_one_dir_item+0xb5/0xb5 [btrfs]
           ? walk_log_tree+0x9c/0x19d [btrfs]
           ? btrfs_read_fs_root_no_radix+0x169/0x1a1 [btrfs]
           ? btrfs_recover_log_trees+0x195/0x29c [btrfs]
           ? replay_one_dir_item+0xb5/0xb5 [btrfs]
           ? btree_read_extent_buffer_pages+0x76/0xbc [btrfs]
           ? open_ctree+0xff6/0x132c [btrfs]

       + If the errors are like above, then zero-log should be used to clear
       the log and the filesystem may be mounted normally again. The keywords
------

Not only "+" is rendered as is, but also wrong indent.

Fix it by adding change line before code block.

Signed-off-by: Qu Wenruo <quwenruo.btrfs@gmx.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2017-08-24 19:06:36 +02:00
David Sterba 3b4927b558 btrfs-progs: docs: update wording for compression mount options
Signed-off-by: David Sterba <dsterba@suse.com>
2017-07-24 16:45:40 +02:00
David Sterba 55110d520b btrfs-progs: docs: adjust wording for subvol delete
Slightly update the text about deletion after the discussion on IRC.

Signed-off-by: David Sterba <dsterba@suse.com>
2017-07-20 17:43:44 +02:00
David Sterba dbcbcd3bca btrfs-progs: docs: enhance documentation of 'btrfs device ready'
There were questions raised about the purpose of the 'dev ready'
command.

Link: https://marc.info/?l=linux-btrfs&m=149944574207325
Signed-off-by: David Sterba <dsterba@suse.com>
2017-07-20 17:43:43 +02:00
David Sterba 1677731660 btrfs-progs: docs: move deprecated mount option to own section
- alloc_start
- recovery
- subvolrootid

Signed-off-by: David Sterba <dsterba@suse.com>
2017-07-20 17:43:43 +02:00
David Sterba cc5c10b675 btrfs-progs: docs: document conventions
Signed-off-by: David Sterba <dsterba@suse.com>
2017-07-03 13:35:10 +02:00
Liu Bo c58d13eeba Btrfs-progs: man: nodesize must be power of 2 now
This updates mkfs.btrfs's man page with the new limitation that nodesize must
be a power of 2 as well.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2017-06-30 16:31:02 +02:00
Kasijjuf ba793d8d70 btrfs-progs: docs: replace <dev> with <device>
As discussed in #50, use 'device' everywhere a path do a device is
expected.

Pull request: #52
Signed-off-by: David Sterba <dsterba@suse.com>
2017-06-26 17:09:46 +02:00
Kasijjuf 3460be233f btrfs-progs: docs: Wrong section in ref to manpage
Pull request: #51
Signed-off-by: David Sterba <dsterba@suse.com>
2017-06-26 17:09:43 +02:00
Kasijjuf 27f0de9d78 btrfs-progs: docs: Expand confusing abbreviation in documentation
While the command interpreter may be able to disambiguate the meaning,
the reader is not helped by being forced to do so.

Pull request: #48
Signed-off-by: David Sterba <dsterba@suse.com>
2017-06-26 17:09:36 +02:00
David Sterba 929a9b188c btrfs-progs: docs: update note about device deletion
User Kasijjuf points out the VFS initialism is not explained anywhere.
While this could be fixed, the whole note about inability to delete the
device by which the filesystem has been mounted, is wrong.

Issue: #49
Signed-off-by: David Sterba <dsterba@suse.com>
2017-06-26 17:09:34 +02:00
Hans van Kranenburg 90f7db78a3 btrfs-progs: send operates on ro snapshots only
While talking to another btrfs user on IRC today, it became clear that a
major point of confusion in the btrfs send manual is that it's not
telling the user soon enough that send/receive solely operates on
subvolume snapshots instead of the original (read/write) subvolumes.

So, change the first few lines to explicitly mention snapshots instead.
Technically, snapshots are also just subvolumes, but requiring this
level of technical detailed knowledge doesn't help the user who is just
trying out things.

Signed-off-by: Hans van Kranenburg <hans.van.kranenburg@mendix.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2017-06-26 17:09:29 +02:00
David Sterba 30c3417b63 btrfs-progs: docs: fix sentence for no-dump file attribute
User Kasijjuf found a nonsensical sentence in the maunal page.

Issue: #45
Signed-off-by: David Sterba <dsterba@suse.com>
2017-06-26 17:09:25 +02:00
David Sterba 019e703e7f btrfs-progs: docs: update formatting of btrfs-property
Reported by a wiki user, that there are formatting artifacts in the
'get' section:

in html rendered as "The -t <em><type></em> option can be..."

This is probably due to the nesting '' and <>. We don't need the <> in
the explanation, as this is only to describe the command line syntax.

Signed-off-by: David Sterba <dsterba@suse.com>
2017-06-26 17:08:18 +02:00
David Sterba 921dc0a973 btrfs-progs: docs: update formatting of btrfs-rescue
Reported by a wiki user, that the 'zero-log' section indentaion is
wrong.

Signed-off-by: David Sterba <dsterba@suse.com>
2017-06-26 17:08:15 +02:00
David Sterba 3ab900a04e btrfs-progs: docs: update formatting and wording for btrfs(5)
- emphasize features in the list
- minor whitespace fixes

Signed-off-by: David Sterba <dsterba@suse.com>
2017-04-20 18:50:02 +02:00