File: btrfs.rst

package info (click to toggle)
btrfs-progs 6.2-1%2Bdeb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 17,244 kB
  • sloc: ansic: 114,376; sh: 9,576; python: 1,242; makefile: 820
file content (192 lines) | stat: -rw-r--r-- 6,204 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
btrfs(8)
========

SYNOPSIS
--------

**btrfs** [global] <group> [<group>...] <command> [<args>]

DESCRIPTION
-----------

The **btrfs** utility is a toolbox for managing btrfs filesystems.  There are
command groups to work with subvolumes, devices, for whole filesystem or other
specific actions. See section *COMMANDS*.

There are also standalone tools for some tasks like **btrfs-convert** or
**btrfstune** that were separate historically and/or haven't been merged to the
main utility. See section *STANDALONE TOOLS* for more details.

For other topics (mount options, etc) please refer to the separate manual
page :doc:`btrfs(5)<btrfs-man5>`.

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>**.

For example: it is possible to run **btrfs sub snaps** instead of
**btrfs subvolume snapshot**.
But **btrfs file s** is not allowed, because **file s** may be interpreted
both as **filesystem show** and as **filesystem sync**.

If the command name is ambiguous, the list of conflicting options is
printed.

*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>`_).

For an overview of a given command use **btrfs command --help**
or **btrfs [command...] --help --full** to print all available options.

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

COMMANDS
--------

balance
	Balance btrfs filesystem chunks across single or several devices.
	See :doc:`btrfs-balance(8)<btrfs-balance>` for details.

check
	Do off-line check on a btrfs filesystem.
	See :doc:`btrfs-check(8)<btrfs-check>` for details.

device
	Manage devices managed by btrfs, including add/delete/scan and so
	on.  See :doc:`btrfs-device(8)<btrfs-device>` for details.

filesystem
	Manage a btrfs filesystem, including label setting/sync and so on.
        See :doc:`btrfs-filesystem(8)<btrfs-filesystem>` for details.

inspect-internal
	Debug tools for developers/hackers.
	See :doc:`btrfs-inspect-internal(8)<btrfs-inspect-internal>` for details.

property
	Get/set a property from/to a btrfs object.
	See :doc:`btrfs-property(8)<btrfs-property>` for details.

qgroup
	Manage quota group(qgroup) for btrfs filesystem.
	See :doc:`btrfs-qgroup(8)<btrfs-qgroup>` for details.

quota
	Manage quota on btrfs filesystem like enabling/rescan and etc.
	See :doc:`btrfs-quota(8)<btrfs-quota>` and :doc:`btrfs-qgroup(8)<btrfs-qgroup>` for details.

receive
	Receive subvolume data from stdin/file for restore and etc.
	See :doc:`btrfs-receive(8)<btrfs-receive>` for details.

replace
	Replace btrfs devices.
	See :doc:`btrfs-replace(8)<btrfs-replace>` for details.

rescue
	Try to rescue damaged btrfs filesystem.
	See :doc:`btrfs-rescue(8)<btrfs-rescue>` for details.

restore
	Try to restore files from a damaged btrfs filesystem.
	See :doc:`btrfs-restore(8)<btrfs-restore>` for details.

scrub
	Scrub a btrfs filesystem.
	See :doc:`btrfs-scrub(8)<btrfs-scrub>` for details.

send
	Send subvolume data to stdout/file for backup and etc.
	See :doc:`btrfs-send(8)<btrfs-send>` for details.

subvolume
	Create/delete/list/manage btrfs subvolume.
	See :doc:`btrfs-subvolume(8)<btrfs-subvolume>` for details.

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.

Tools that are still in active use without an equivalent in **btrfs**:

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
or hardlinks. The full list can be obtained by **btrfs help --box**.

EXIT STATUS
-----------

**btrfs** returns a zero exit status if it succeeds. Non zero is returned in
case of failure.

AVAILABILITY
------------

**btrfs** is part of btrfs-progs.  Please refer to the documentation at
https://btrfs.readthedocs.io or wiki http://btrfs.wiki.kernel.org for further
information.

SEE ALSO
--------

: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>`