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>
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>
- "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>
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>
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>
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>
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>
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>
- 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>