1BTRFS-INSPECT-INTERNAL(8) BTRFS BTRFS-INSPECT-INTERNAL(8)
2
3
4
6 btrfs-inspect-internal - query various internal information
7
9 btrfs inspect-internal <subcommand> <args>
10
12 This command group provides an interface to query internal information.
13 The functionality ranges from a simple UI to an ioctl or a more complex
14 query that assembles the result from several internal structures. The
15 latter usually requires calls to privileged ioctls.
16
18 dump-super [options] <device> [device...]
19 (replaces the standalone tool btrfs-show-super)
20
21 Show btrfs superblock information stored on given devices in
22 textual form. By default the first superblock is printed, more
23 details about all copies or additional backup data can be
24 printed.
25
26 Besides verification of the filesystem signature, there are no
27 other sanity checks. The superblock checksum status is reported,
28 the device item and filesystem UUIDs are checked and reported.
29
30 NOTE:
31 The meaning of option -s has changed in version 4.8 to be
32 consistent with other tools to specify superblock copy rather
33 the offset. The old way still works, but prints a warning.
34 Please update your scripts to use --bytenr instead. The op‐
35 tion -i has been deprecated.
36
37 Options
38
39 -f|--full
40 print full superblock information, including the system
41 chunk array and backup roots
42
43 -a|--all
44 print information about all present superblock copies
45 (cannot be used together with -s option)
46
47 -i <super>
48 (deprecated since 4.8, same behaviour as --super)
49
50 --bytenr <bytenr>
51 specify offset to a superblock in a non-standard location
52 at bytenr, useful for debugging (disables the -f option)
53
54 If there are multiple options specified, only the last
55 one applies.
56
57 -F|--force
58 attempt to print the superblock even if a valid BTRFS
59 signature is not found; the result may be completely
60 wrong if the data does not resemble a superblock
61
62 -s|--super <bytenr>
63 (see compatibility note above)
64
65 specify which mirror to print, valid values are 0, 1 and
66 2 and the superblock must be present on the device with a
67 valid signature, can be used together with --force
68
69 dump-tree [options] <device> [device...]
70 (replaces the standalone tool btrfs-debug-tree)
71
72 Dump tree structures from a given device in textual form, expand
73 keys to human readable equivalents where possible. This is use‐
74 ful for analyzing filesystem state or inconsistencies and has a
75 positive educational effect on understanding the internal
76 filesystem structure.
77
78 NOTE:
79 Contains file names, consider that if you're asked to send
80 the dump for analysis. Does not contain file data.
81
82 Options
83
84 -e|--extents
85 print only extent-related information: extent and device
86 trees
87
88 -d|--device
89 print only device-related information: tree root, chunk
90 and device trees
91
92 -r|--roots
93 print only short root node information, ie. the root tree
94 keys
95
96 -R|--backups
97 same as --roots plus print backup root info, ie. the
98 backup root keys and the respective tree root block off‐
99 set
100
101 -u|--uuid
102 print only the uuid tree information, empty output if the
103 tree does not exist
104
105 -b <block_num>
106 print info of the specified block only, can be specified
107 multiple times
108
109 --follow
110 use with -b, print all children tree blocks of
111 <block_num>
112
113 --dfs (default up to 5.2)
114
115 use depth-first search to print trees, the nodes and
116 leaves are intermixed in the output
117
118 --bfs (default since 5.3)
119
120 use breadth-first search to print trees, the nodes are
121 printed before all leaves
122
123 --hide-names
124 print a placeholder HIDDEN instead of various names, use‐
125 ful for developers to inspect the dump while keeping po‐
126 tentially sensitive information hidden
127
128 This is:
129
130 • directory entries (files, directories, subvolumes)
131
132 • default subvolume
133
134 • extended attributes (name, value)
135
136 • hardlink names (if stored inside another item or as ex‐
137 tended references in standalone items)
138
139 NOTE:
140 Lengths are not hidden because they can be calculated
141 from the item size anyway.
142
143 --csum-headers
144 print b-tree node checksums stored in headers (metadata)
145
146 --csum-items
147 print checksums stored in checksum items (data)
148
149 --noscan
150 do not automatically scan the system for other devices
151 from the same filesystem, only use the devices provided
152 as the arguments
153
154 -t <tree_id>
155 print only the tree with the specified ID, where the ID
156 can be numerical or common name in a flexible human read‐
157 able form
158
159 The tree id name recognition rules:
160
161 • case does not matter
162
163 • the C source definition, eg. BTRFS_ROOT_TREE_OBJECTID
164
165 • short forms without BTRFS_ prefix, without _TREE and
166 _OBJECTID suffix, eg. ROOT_TREE, ROOT
167
168 • convenience aliases, eg. DEVICE for the DEV tree,
169 CHECKSUM for CSUM
170
171 • unrecognized ID is an error
172
173 inode-resolve [-v] <ino> <path>
174 (needs root privileges)
175
176 resolve paths to all files with given inode number ino in a
177 given subvolume at path, ie. all hardlinks
178
179 Options
180
181 -v (deprecated) alias for global -v option
182
183 logical-resolve [-Pvo] [-s <bufsize>] <logical> <path>
184 (needs root privileges)
185
186 resolve paths to all files at given logical address in the lin‐
187 ear filesystem space
188
189 Options
190
191 -P skip the path resolving and print the inodes instead
192
193 -o ignore offsets, find all references to an extent instead
194 of a single block. Requires kernel support for the V2
195 ioctl (added in 4.15). The results might need further
196 processing to filter out unwanted extents by the offset
197 that is supposed to be obtained by other means.
198
199 -s <bufsize>
200 set internal buffer for storing the file names to buf‐
201 size, default is 64KiB, maximum 16MiB. Buffer sizes over
202 64Kib require kernel support for the V2 ioctl (added in
203 4.15).
204
205 -v (deprecated) alias for global -v option
206
207 min-dev-size [options] <path>
208 (needs root privileges)
209
210 return the minimum size the device can be shrunk to, without
211 performing any resize operation, this may be useful before exe‐
212 cuting the actual resize operation
213
214 Options
215
216 --id <id>
217 specify the device id to query, default is 1 if this op‐
218 tion is not used
219
220 rootid <path>
221 for a given file or directory, return the containing tree root
222 id, but for a subvolume itself return its own tree id (ie. sub‐
223 vol id)
224
225 NOTE:
226 The result is undefined for the so-called empty subvolumes
227 (identified by inode number 2), but such a subvolume does not
228 contain any files anyway
229
230 subvolid-resolve <subvolid> <path>
231 (needs root privileges)
232
233 resolve the absolute path of the subvolume id subvolid
234
235 tree-stats [options] <device>
236 (needs root privileges)
237
238 Print sizes and statistics of trees.
239
240 Options
241
242 -b Print raw numbers in bytes.
243
245 btrfs inspect-internal returns a zero exit status if it succeeds. Non
246 zero is returned in case of failure.
247
249 btrfs is part of btrfs-progs. Please refer to the btrfs wiki
250 http://btrfs.wiki.kernel.org for further details.
251
253 mkfs.btrfs(8)
254
256 2022
257
258
259
260
2615.18 May 25, 2022 BTRFS-INSPECT-INTERNAL(8)