2021-10-26 22:45:24 +00:00
|
|
|
btrfs(8)
|
|
|
|
========
|
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
--------
|
|
|
|
|
2023-02-22 00:21:07 +00:00
|
|
|
**btrfs** [global] <group> [<group>...] <command> [<args>]
|
2021-10-26 22:45:24 +00:00
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
-----------
|
|
|
|
|
2023-04-26 23:48:47 +00:00
|
|
|
The :command:`btrfs` utility is a toolbox for managing btrfs filesystems. There are
|
2021-10-26 22:45:24 +00:00
|
|
|
command groups to work with subvolumes, devices, for whole filesystem or other
|
|
|
|
specific actions. See section *COMMANDS*.
|
|
|
|
|
2023-04-26 23:48:47 +00:00
|
|
|
There are also standalone tools for some tasks like :command:`btrfs-convert` or
|
|
|
|
:command:`btrfstune` that were separate historically and/or haven't been merged to the
|
2021-10-26 22:45:24 +00:00
|
|
|
main utility. See section *STANDALONE TOOLS* for more details.
|
|
|
|
|
|
|
|
For other topics (mount options, etc) please refer to the separate manual
|
2022-08-08 07:28:56 +00:00
|
|
|
page :doc:`btrfs(5)<btrfs-man5>`.
|
2021-10-26 22:45:24 +00:00
|
|
|
|
|
|
|
COMMAND SYNTAX
|
|
|
|
--------------
|
|
|
|
|
|
|
|
Any command name can be shortened so long as the shortened form is unambiguous,
|
|
|
|
however, it is recommended to use full command names in scripts. All command
|
|
|
|
groups have their manual page named **btrfs-<group>**.
|
|
|
|
|
2023-04-26 23:48:47 +00:00
|
|
|
For example: it is possible to run :command:`btrfs sub snaps` instead of
|
|
|
|
:command:`btrfs subvolume snapshot`.
|
|
|
|
But :command:`btrfs file s` is not allowed, because :command:`file s` may be interpreted
|
|
|
|
both as :command:`filesystem show` and as :command:`filesystem sync`.
|
2021-10-26 22:45:24 +00:00
|
|
|
|
|
|
|
If the command name is ambiguous, the list of conflicting options is
|
|
|
|
printed.
|
|
|
|
|
2022-12-26 11:32:14 +00:00
|
|
|
*Sizes*, both upon input and output, can be expressed in either SI or IEC-I
|
|
|
|
units (see `numfmt(1) <https://www.man7.org/linux/man-pages/man1/numfmt.1.html>`_)
|
|
|
|
with the suffix `B` appended.
|
|
|
|
All numbers will be formatted according to the rules of the `C` locale
|
|
|
|
(ignoring the shell locale, see `locale(7) <https://man7.org/linux/man-pages/man7/locale.7.html>`_).
|
|
|
|
|
2023-04-26 23:48:47 +00:00
|
|
|
For an overview of a given command use :command:`btrfs command --help`
|
|
|
|
or :command:`btrfs [command...] --help --full` to print all available options.
|
2021-10-26 22:45:24 +00:00
|
|
|
|
2023-02-22 00:21:07 +00:00
|
|
|
There are global options that are passed between *btrfs* and the *group* name
|
|
|
|
and affect behaviour not specific to the command, e.g. verbosity or the type
|
|
|
|
of the output.
|
|
|
|
|
|
|
|
--format <format>
|
|
|
|
if supported by the command, print subcommand output in that format (text, json)
|
|
|
|
|
|
|
|
-v|--verbose
|
|
|
|
increase verbosity of the subcommand\n"
|
|
|
|
|
|
|
|
-q|--quiet
|
|
|
|
print only errors\n"
|
|
|
|
|
|
|
|
--log <level>
|
|
|
|
set log level (default, info, verbose, debug, quiet)\n"
|
|
|
|
|
|
|
|
The remaining options are relevant only for the main tool:
|
|
|
|
|
|
|
|
--help
|
|
|
|
print condensed help for all subcommands
|
|
|
|
|
|
|
|
--version
|
|
|
|
print version string
|
|
|
|
|
2021-10-26 22:45:24 +00:00
|
|
|
COMMANDS
|
|
|
|
--------
|
|
|
|
|
|
|
|
balance
|
|
|
|
Balance btrfs filesystem chunks across single or several devices.
|
2022-08-08 07:28:56 +00:00
|
|
|
See :doc:`btrfs-balance(8)<btrfs-balance>` for details.
|
2021-10-26 22:45:24 +00:00
|
|
|
|
|
|
|
check
|
|
|
|
Do off-line check on a btrfs filesystem.
|
2022-08-08 07:28:56 +00:00
|
|
|
See :doc:`btrfs-check(8)<btrfs-check>` for details.
|
2021-10-26 22:45:24 +00:00
|
|
|
|
|
|
|
device
|
|
|
|
Manage devices managed by btrfs, including add/delete/scan and so
|
2022-08-08 07:28:56 +00:00
|
|
|
on. See :doc:`btrfs-device(8)<btrfs-device>` for details.
|
2021-10-26 22:45:24 +00:00
|
|
|
|
|
|
|
filesystem
|
|
|
|
Manage a btrfs filesystem, including label setting/sync and so on.
|
2022-08-08 07:28:56 +00:00
|
|
|
See :doc:`btrfs-filesystem(8)<btrfs-filesystem>` for details.
|
2021-10-26 22:45:24 +00:00
|
|
|
|
|
|
|
inspect-internal
|
|
|
|
Debug tools for developers/hackers.
|
2022-08-08 07:28:56 +00:00
|
|
|
See :doc:`btrfs-inspect-internal(8)<btrfs-inspect-internal>` for details.
|
2021-10-26 22:45:24 +00:00
|
|
|
|
|
|
|
property
|
|
|
|
Get/set a property from/to a btrfs object.
|
2022-08-08 07:28:56 +00:00
|
|
|
See :doc:`btrfs-property(8)<btrfs-property>` for details.
|
2021-10-26 22:45:24 +00:00
|
|
|
|
|
|
|
qgroup
|
|
|
|
Manage quota group(qgroup) for btrfs filesystem.
|
2022-08-08 07:28:56 +00:00
|
|
|
See :doc:`btrfs-qgroup(8)<btrfs-qgroup>` for details.
|
2021-10-26 22:45:24 +00:00
|
|
|
|
|
|
|
quota
|
|
|
|
Manage quota on btrfs filesystem like enabling/rescan and etc.
|
2022-08-08 07:28:56 +00:00
|
|
|
See :doc:`btrfs-quota(8)<btrfs-quota>` and :doc:`btrfs-qgroup(8)<btrfs-qgroup>` for details.
|
2021-10-26 22:45:24 +00:00
|
|
|
|
|
|
|
receive
|
|
|
|
Receive subvolume data from stdin/file for restore and etc.
|
2022-08-08 07:28:56 +00:00
|
|
|
See :doc:`btrfs-receive(8)<btrfs-receive>` for details.
|
2021-10-26 22:45:24 +00:00
|
|
|
|
|
|
|
replace
|
|
|
|
Replace btrfs devices.
|
2022-08-08 07:28:56 +00:00
|
|
|
See :doc:`btrfs-replace(8)<btrfs-replace>` for details.
|
2021-10-26 22:45:24 +00:00
|
|
|
|
|
|
|
rescue
|
|
|
|
Try to rescue damaged btrfs filesystem.
|
2022-08-08 07:28:56 +00:00
|
|
|
See :doc:`btrfs-rescue(8)<btrfs-rescue>` for details.
|
2021-10-26 22:45:24 +00:00
|
|
|
|
|
|
|
restore
|
|
|
|
Try to restore files from a damaged btrfs filesystem.
|
2022-08-08 07:28:56 +00:00
|
|
|
See :doc:`btrfs-restore(8)<btrfs-restore>` for details.
|
2021-10-26 22:45:24 +00:00
|
|
|
|
|
|
|
scrub
|
|
|
|
Scrub a btrfs filesystem.
|
2022-08-08 07:28:56 +00:00
|
|
|
See :doc:`btrfs-scrub(8)<btrfs-scrub>` for details.
|
2021-10-26 22:45:24 +00:00
|
|
|
|
|
|
|
send
|
|
|
|
Send subvolume data to stdout/file for backup and etc.
|
2022-08-08 07:28:56 +00:00
|
|
|
See :doc:`btrfs-send(8)<btrfs-send>` for details.
|
2021-10-26 22:45:24 +00:00
|
|
|
|
|
|
|
subvolume
|
|
|
|
Create/delete/list/manage btrfs subvolume.
|
2022-08-08 07:28:56 +00:00
|
|
|
See :doc:`btrfs-subvolume(8)<btrfs-subvolume>` for details.
|
2021-10-26 22:45:24 +00:00
|
|
|
|
|
|
|
STANDALONE TOOLS
|
|
|
|
----------------
|
|
|
|
|
|
|
|
New functionality could be provided using a standalone tool. If the functionality
|
|
|
|
proves to be useful, then the standalone tool is declared obsolete and its
|
|
|
|
functionality is copied to the main tool. Obsolete tools are removed after a
|
|
|
|
long (years) depreciation period.
|
|
|
|
|
2023-04-26 23:48:47 +00:00
|
|
|
Tools that are still in active use without an equivalent in :command:`btrfs`:
|
2021-10-26 22:45:24 +00:00
|
|
|
|
|
|
|
btrfs-convert
|
|
|
|
in-place conversion from ext2/3/4 filesystems to btrfs
|
|
|
|
btrfstune
|
|
|
|
tweak some filesystem properties on a unmounted filesystem
|
|
|
|
btrfs-select-super
|
|
|
|
rescue tool to overwrite primary superblock from a spare copy
|
|
|
|
btrfs-find-root
|
|
|
|
rescue helper to find tree roots in a filesystem
|
|
|
|
|
|
|
|
For space-constrained environments, it's possible to build a single binary with
|
|
|
|
functionality of several standalone tools. This is following the concept of
|
|
|
|
busybox where the file name selects the functionality. This works for symlinks
|
2023-04-26 23:48:47 +00:00
|
|
|
or hardlinks. The full list can be obtained by :command:`btrfs help --box`.
|
2021-10-26 22:45:24 +00:00
|
|
|
|
|
|
|
EXIT STATUS
|
|
|
|
-----------
|
|
|
|
|
|
|
|
**btrfs** returns a zero exit status if it succeeds. Non zero is returned in
|
|
|
|
case of failure.
|
|
|
|
|
|
|
|
AVAILABILITY
|
|
|
|
------------
|
|
|
|
|
2022-10-06 15:52:25 +00:00
|
|
|
**btrfs** is part of btrfs-progs. Please refer to the documentation at
|
2023-03-16 21:38:21 +00:00
|
|
|
`https://btrfs.readthedocs.io <https://btrfs.readthedocs.io>`_.
|
2021-10-26 22:45:24 +00:00
|
|
|
|
|
|
|
SEE ALSO
|
|
|
|
--------
|
|
|
|
|
2022-08-08 07:28:56 +00:00
|
|
|
:doc:`btrfs(5)<btrfs-man5>`,
|
|
|
|
:doc:`btrfs-balance(8)<btrfs-balance>`,
|
|
|
|
:doc:`btrfs-check(8)<btrfs-check>`,
|
|
|
|
:doc:`btrfs-convert(8)<btrfs-convert>`,
|
|
|
|
:doc:`btrfs-device(8)<btrfs-device>`,
|
|
|
|
:doc:`btrfs-filesystem(8)<btrfs-filesystem>`,
|
|
|
|
:doc:`btrfs-inspect-internal(8)<btrfs-inspect-internal>`,
|
|
|
|
:doc:`btrfs-property(8)<btrfs-property>`,
|
|
|
|
:doc:`btrfs-qgroup(8)<btrfs-qgroup>`,
|
|
|
|
:doc:`btrfs-quota(8)<btrfs-quota>`,
|
|
|
|
:doc:`btrfs-receive(8)<btrfs-receive>`,
|
|
|
|
:doc:`btrfs-replace(8)<btrfs-replace>`,
|
|
|
|
:doc:`btrfs-rescue(8)<btrfs-rescue>`,
|
|
|
|
:doc:`btrfs-restore(8)<btrfs-restore>`,
|
|
|
|
:doc:`btrfs-scrub(8)<btrfs-scrub>`,
|
|
|
|
:doc:`btrfs-send(8)<btrfs-send>`,
|
|
|
|
:doc:`btrfs-subvolume(8)<btrfs-subvolume>`,
|
|
|
|
:doc:`btrfstune(8)<btrfstune>`,
|
|
|
|
:doc:`mkfs.btrfs(8)<mkfs.btrfs>`
|