Commit Graph

626 Commits

Author SHA1 Message Date
David Sterba 455b1cf094 btrfs-progs: tune: rename bgt conversion options
Rename the options so they more accurately reflect what the command is
actually doing. The feature is enabled/disabled in the end but it's not
a simple on/off like for others, the conversion takes time.

Signed-off-by: David Sterba <dsterba@suse.com>
2023-04-27 14:23:52 +02:00
David Sterba f560eb4c0b btrfs-progs: docs: remove EXTLINUX from bootloaders
There has been no update since 2014 and it's likely broken due to many
new features added to btrfs since then.

Signed-off-by: David Sterba <dsterba@suse.com>
2023-04-27 01:52:25 +02:00
David Sterba 1afe51d22d btrfs-progs: docs: use command role for programs or command lines
Replace **bold** or ``quoted`` with :command:`line ...` that is supposed
to be used verbatim.

Signed-off-by: David Sterba <dsterba@suse.com>
2023-04-27 01:48:47 +02:00
Christoph Anton Mitterer 405f4c73e8 btrfs-progs: docs: improve space cache documentation
- "Wipe" in storage terms is often understood as some kind of secure
  deletion.  Use "remove" instead in order to indicate that the space
  cache is fully removed (and not just cleared and then e.g.
  automatically rebuild).

- The --clear-space-cache option for btrfs check actually clears the
  whole space cache, just as documented.  Thus move any documentation
  about the clear_cache mount option not doing so for v1 to that.
  Instead, refer to the mount option.

- Also note that when clear_cache is used with v1, the free space cache
  for block groups that are modified gets always cleared, but rebuilt
  only if nospace_cache is not used.

Pull-request: #571
Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
Signed-off-by: David Sterba <dsterba@suse.com>
2023-04-27 00:51:22 +02:00
Christoph Anton Mitterer 321b2f61fe btrfs-progs: docs: swapfile clarifications
Clarify active vs. inactive swapfile regarding snapshotting and further minor
improvements.

Issue: #608
Pull-request: #618
Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
Signed-off-by: David Sterba <dsterba@suse.com>
2023-04-26 23:24:44 +02:00
David Sterba 93d51b286c btrfs-progs: docs: mention discard=async in mount options
Issue: #617
Signed-off-by: David Sterba <dsterba@suse.com>
2023-04-26 12:42:39 +02:00
David Sterba d7f2ee3300 btrfs-progs: docs: add linux 6.3 changes
Signed-off-by: David Sterba <dsterba@suse.com>
2023-04-25 16:59:42 +02:00
David Sterba 5dd176d79e btrfs-progs: docs: clarify swapfile
Clarify active vs inactive swapfile regarding snapshotting.

Issue: #608
Signed-off-by: David Sterba <dsterba@suse.com>
2023-04-25 16:59:42 +02:00
David Sterba 33560e2768 btrfs-progs: docs: update Zoned mode
Copy remaining text from wiki.

Signed-off-by: David Sterba <dsterba@suse.com>
2023-04-25 16:59:42 +02:00
David Sterba cdb82bf762 btrfs-progs: check: document --force + --repair
The combination of --force and --repair was mistakenly documented as not
working on a mounted filesystem. Update help text, documentation and the
warning itself.

Issue: #503
Signed-off-by: David Sterba <dsterba@suse.com>
2023-04-25 16:59:42 +02:00
David Sterba 6ef6c07ef7 btrfs-progs: docs: update scrub manual page
Move ionice options, add example output of status with explanation.

Issue: #200
Signed-off-by: David Sterba <dsterba@suse.com>
2023-04-25 16:59:42 +02:00
David Sterba 79bb885c08 btrfs-progs: docs: correct default regarding space cache
The docs got outdated regarding the default version of the free space
cache.

Issue: #560
Signed-off-by: David Sterba <dsterba@suse.com>
2023-04-25 16:59:42 +02:00
starship-boi 858a41e6b1 btrfs-progs: docs: typo/clarity fix in Introduction
Pull-request: #614
Signed-off-by: David Sterba <dsterba@suse.com>
2023-04-25 16:59:42 +02:00
Qu Wenruo 68a04bc710 btrfs-progs: tune: add new option to convert back to extent tree
With previous btrfstune support to convert to block-group-tree, it has
implemented most of the infrastructure for bi-directional conversion.

This patch will implement the remaining conversion support to go back to
extent tree.

The modification includes:

- New convert_to_extent_tree() function in btrfstune.c
  It's almost the same as convert_to_bg_tree(), but with small changes:
  * No need to set extra features like NO_HOLES/FST.
  * Need to delete the block group tree when everything finished.

- Update btrfs_delete_and_free_root() to handle non-global roots
  Currently the function can only accepts global roots (extent/csum/free
  space trees)

  If we pass a non-global root into the function, we will screw up
  global_roots_tree and crash.

  Since we're going to use btrfs_delete_and_free_root() to free block
  group tree which is not a global tree, this is needed.

- New handling for half converted fs in get_last_converted_bg()
  There are two cases need to be handled:

  * The bg tree is already empty
    We need to grab the first bg in extent tree.
    Or at conversion function we will fail at grabbing the first bg.

  * The bg tree is not empty
    Then we need to grab the last bg in extent tree.

- Extra root switching in involved functions. This involves:

  * read_converting_block_groups()
  * insert_block_group_item()
  * update_block_group_item()

  We just need to update our target root according to the current
  compat_ro and super flags.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2023-04-19 01:10:24 +02:00
Qu Wenruo 716c3be363 btrfs-progs: move block-group-tree out of experimental features
The feedback from the community on block group tree is very positive,
the only complain is, end users need to recompile btrfs-progs with
experimental features to enjoy the new feature.

So let's move it out of experimental features and let more people enjoy
faster mount speed.

Also change the option of btrfstune, from `-b` to
`--enable-block-group-tree` to avoid short option.

Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2023-04-17 19:28:05 +02:00
Qu Wenruo 4dbe66ca2f btrfs-progs: mkfs: make -R|--runtime-features option deprecated
The option -R|--runtime-features was introduced to support features that
don't result in a full incompat flag change, thus things like
free-space-tree and quota features are put here.

But to end users, such separation of features is not helpful and can be
sometimes confusing.

Thus we're already migrating those runtime features into -O|--features
option under experimental builds.

I believe this is the proper time to move those runtime features into
-O|--features option, and mark the -R|--runtime-features option
deprecated.

For now we still keep the old option as for compatibility purposes.

Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2023-04-17 19:27:53 +02:00
David Sterba 07d29fedd2 btrfs-progs: docs: reformat kernel-by-version
- convert "*" lists to "-" for newer releases, this is preferred in pull
  requests
- update nested lists to the more compact layout (add more newlines,
  un-indent)
- wrap overly long lines

Signed-off-by: David Sterba <dsterba@suse.com>
2023-04-12 01:31:34 +02:00
David Sterba c62a19a067 btrfs-progs: docs: update kernel changelogs 5.18 - 6.3
Signed-off-by: David Sterba <dsterba@suse.com>
2023-04-12 01:14:57 +02:00
David Sterba 0da68b0065 btrfs-progs: docs: add On disk format
Copied from wiki. May contain out of date information and formatting
mistakes.

Signed-off-by: David Sterba <dsterba@suse.com>
2023-04-05 01:39:42 +02:00
David Sterba 1551d764c9 btrfs-progs: docs: add Developer's FAQ
Copied from wiki.

Signed-off-by: David Sterba <dsterba@suse.com>
2023-04-05 01:18:06 +02:00
David Sterba b95d4d3d01 btrfs-progs: docs: add Development notes
Copied from wiki.

Signed-off-by: David Sterba <dsterba@suse.com>
2023-04-05 01:03:49 +02:00
David Sterba dba785a9db btrfs-progs: docs: group developer documentation
Add new directory and move ther all exisisting documentation meant for
developers.

Signed-off-by: David Sterba <dsterba@suse.com>
2023-04-05 00:20:41 +02:00
David Sterba 540e94275a btrfs-progs: docs: convert send stream protocol descriptions to tables
Signed-off-by: David Sterba <dsterba@suse.com>
2023-04-05 00:14:59 +02:00
David Sterba 2f8fc64d50 btrfs-progs: docs: convert btrfs-ioctl to more compact format
Use tabular format instead of the defintion list as it's more compact.
Enable syntax hilighting to code examples.

Signed-off-by: David Sterba <dsterba@suse.com>
2023-03-22 20:07:50 +01:00
David Sterba 403ba6e6ee btrfs-progs: docs: add some design-related documents
Copied from wiki.

Signed-off-by: David Sterba <dsterba@suse.com>
2023-03-22 14:39:17 +01:00
David Sterba 5e4a18b4b5 btrfs-progs: docs: add kernel version changes
Copy from wiki.

Signed-off-by: David Sterba <dsterba@suse.com>
2023-03-22 14:39:15 +01:00
David Sterba 2c5f8de36b btrfs-progs: docs: add Status page from wiki
Signed-off-by: David Sterba <dsterba@suse.com>
2023-03-22 14:39:13 +01:00
Alexander Barton d82c2ca63c btrfs-progs: docs: fix name of "mountinfo" file in subvolume intro
The name of a mounted sub volume can not be found in /proc/self/mounts
but in /proc/self/mountinfo.

Pull-request: #596
Signed-off-by: Alexander Barton <alex@barton.de>
Signed-off-by: David Sterba <dsterba@suse.com>
2023-03-17 18:14:18 +01:00
softwarecreations 36fcaa1a7b btrfs-progs: docs: update swapfile Added size to mkswapfile example
Let's show users how to set the size of their new swapfile.

Pull-request: #601
Signed-off-by: David Sterba <dsterba@suse.com>
2023-03-16 23:15:15 +01:00
David Sterba 02ffc977be btrfs-progs: docs: don't use wiki links in manual pages and package
The wiki has been archived so remove the links from manual page
footers. Also replace the wiki link by RTD site in configure and
libbtrfsutil.

Signed-off-by: David Sterba <dsterba@suse.com>
2023-03-16 22:38:21 +01:00
Anand Jain 4a37203c8a btrfs-progs: docs: discard tunables and metrics in sysfs
Since kernel v6.1, we have had discard tunables and metrics under sysfs.
Add documentation for them.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2023-03-16 15:48:48 +01:00
Tobias Kaiser 3edfc2b29a btrfs-progs: docs: fix typo in subvolume intro
Author: Tobias Kaiser <mail@tb-kaiser.de>
Signed-off-by: David Sterba <dsterba@suse.com>
2023-03-07 20:52:35 +01:00
David Sterba b1c159b804 btrfs-progs: docs: add 6.2 development statistics
Signed-off-by: David Sterba <dsterba@suse.com>
2023-02-28 20:11:24 +01:00
David Sterba dde2f15010 btrfs-progs: docs: remove mentions of btrfs-debug-tree, btrfs-show-super, btrfs-zero-log
The standalone tools have been deprecated and removed in 2018 and nobody
should miss them.

Signed-off-by: David Sterba <dsterba@suse.com>
2023-02-28 20:11:23 +01:00
David Sterba 5edf4950b4 btrfs-progs: reformat global options and update docs
With the growing list of global option we need to print them somewhere
in the help text and document them.

Signed-off-by: David Sterba <dsterba@suse.com>
2023-02-28 20:11:23 +01:00
David Sterba b08b429ee2 btrfs-progs: fi mkswapfile: add option --uuid
Add option --uuid with same semantics that is provided by command
'mkswap'. By default a random UUID is generated, to not set any use
'btrfs filesystem mkswapfile -U clear swapfile'.

Issue: #581
Signed-off-by: David Sterba <dsterba@suse.com>
2023-02-28 20:11:22 +01:00
Christopher Yeleighton 29017208b8 btrfs-progs: docs: describe formatting of sizes
Input must be prepared and output must be interpreted under the C
locale, which requires special precautions on the client’s side.

Pull-request: #561
Author: Christopher Yeleighton <ne01026@shark.2a.pl>
Signed-off-by: David Sterba <dsterba@suse.com>
2023-01-25 16:20:36 +01:00
pinysuse 7f10503bcd btrfs-progs: docs: add heading to ch-mount-options.rst
The header of the main section seems to be missing --> added.

Pull-request: #565
Author: pinysuse
Signed-off-by: David Sterba <dsterba@suse.com>
2023-01-25 16:20:33 +01:00
Christopher Head cf7b55a980 btrfs-progs: docs: document some subvolume related ioctls
Author: Christopher Head <chead@chead.ca>
Signed-off-by: David Sterba <dsterba@suse.com>
2023-01-25 16:20:31 +01:00
Christopher Head c5e3671121 btrfs-progs: docs: add missing ioctl names to the list
Author: Christopher Head <chead@chead.ca>
Signed-off-by: David Sterba <dsterba@suse.com>
2023-01-25 16:20:28 +01:00
Christopher Head 23b2f8a1e7 btrfs-progs: docs: add struct btrfs_ioctl_get_subvol_info_args
Author: Christopher Head <chead@chead.ca>
Signed-off-by: David Sterba <dsterba@suse.com>
2023-01-25 16:20:27 +01:00
Christopher Head 3387667966 btrfs-progs: docs: add up-to-date definition of btrfs_ioctl_vol_args_v2
Author: Christopher Head <chead@chead.ca>
Signed-off-by: David Sterba <dsterba@suse.com>
2023-01-25 16:20:24 +01:00
Naohiro Aota 2b4bebeacc btrfs-progs: docs: add sysfs chunk_size description
Add description for /sys/fs/btrfs/<uuid>/allocation/<type>/chunk_size.

Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2023-01-25 16:20:18 +01:00
Naohiro Aota 2a20dc237c btrfs-progs: docs: fix sysfs nodesize typo
Fix the typo.

Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2023-01-25 16:20:16 +01:00
Naohiro Aota cdcdcf17af btrfs-progs: docs: add sysfs per-space_info bg_reclaim_threshold entry
There are two "bg_reclaim_threshold" under the sysfs directory. One is at
/sys/fs/btrfs/<UUID>/ and sets the threshold to start the auto reclaim
thread. The other one is
at/sys/fs/btrfs/<UUID>/allocations/{data,metadata,system} and sets the
threshold to reclaim a block group.

These two options have the same name but they are calculated against
different metrics. The former is a percentage of allocated (for a device
extent) space on total device space, and the latter is a percentage of
reclaimable space on a block group's zone capacity.

Add description for per-space_info bg_reclaim_threshold to distinguish
these two same name configurations.

Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2023-01-25 16:20:14 +01:00
David Sterba f5884fc8ca btrfs-progs: docs: drop copyright year from manual pages
The copyright config variable can be used for a real copyright but we
don't have that for the manual pages and it was a stub. The date of page
generation time is added to the page anyway.

Signed-off-by: David Sterba <dsterba@suse.com>
2023-01-25 16:19:51 +01:00
Qu Wenruo 0d901db20a btrfs-progs: docs: add sysfs doc
This patch will add a dedicated section for btrfs sysfs interfaces.

It will include:

- Directory layout explanation
  Including:
  * Description
  * Introduced in which kernel version

- Files explanation
  Including:
  * RW/RO type
  * Description
  * Introduced in which kernel version

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2023-01-25 16:19:43 +01:00
David Sterba 54b90cb6e5 btrfs-progs: fi mkswapfile: fix page count in header
Per user report on https://old.reddit.com/r/btrfs/comments/107fnw1/btrfs_filesystem_mkswapfile_results_in_an/
the swapfile header does not contain the correct number of pages that
matches the file size and the activated swapfile is only 1GiB:

  # btrfs filesystem mkswapfile -s 10g swapfile
  # swapon swapfile
  # cat /proc/swaps
  Filename          Type    Size       Used    Priority
  /swap/swapfile    file    1048572    0       -2

A workaround is to run 'mkswap swapfile' before activation. Proper fix
is to calculate the number of (fixed size) 4K pages available for the
swap.

Issue: #568
Signed-off-by: David Sterba <dsterba@suse.com>
2023-01-25 16:19:36 +01:00
David Sterba 3a5adfb1a4 btrfs-progs: docs: add some kernel 6.1 release notes
Signed-off-by: David Sterba <dsterba@suse.com>
2022-12-22 19:01:45 +01:00
David Sterba 4f7bf100a9 btrfs-progs: docs: typo fixups and formatting updates
Signed-off-by: David Sterba <dsterba@suse.com>
2022-12-22 18:44:47 +01:00