1BTRFS-INSPECT-INTE(8) Btrfs Manual BTRFS-INSPECT-INTE(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 printed.
24
25 Besides verifictaion of the filesystem signature, there are no
26 other sanity checks. The superblock checksum status is reported,
27 the device item and filesystem UUIDs are checked and reported.
28
29 Note
30 the meaning of option -s has changed in version 4.8 to be
31 consistent with other tools to specify superblock copy rather
32 the offset. The old way still works, but prints a warning.
33 Please update your scripts to use --bytenr instead. The option
34 -i has been deprecated.
35 Options
36
37 -f|--full
38 print full superblock information, including the system chunk
39 array and backup roots
40
41 -a|--all
42 print information about all present superblock copies (cannot
43 be used together with -s option)
44
45 -i <super>
46 (deprecated since 4.8, same behaviour as --super)
47
48 --bytenr <bytenr>
49 specify offset to a superblock in a non-standard location at
50 bytenr, useful for debugging (disables the -f option)
51
52 If there are multiple options specified, only the last one
53 applies.
54
55 -F|--force
56 attempt to print the superblock even if thre’s no valid BTRFS
57 signature found, the result may be completely wrong if the data
58 do not resemble a superblock
59
60 -s|--super <bytenr>
61 (see compatibility note above)
62
63 specify which mirror to print, valid values are 0, 1 and 2 and
64 the superblock must be present on the device with a valid
65 signature, can be used together with --force
66
67 dump-tree [options] <device>
68 (replaces the standalone tool btrfs-debug-tree)
69
70 Dump tree structures from a given device in textual form, expand
71 keys to human readable equivalents where possible. This is useful
72 for analyzing filesystem state or inconsistencies and has a
73 positive educational effect on understanding the internal
74 filesystem structure.
75
76 Note
77 contains file names, consider that if you’re asked to send the
78 dump for analysis. Does not contain file data.
79 Options
80
81 -e|--extents
82 print only extent-related information: extent and device trees
83
84 -d|--device
85 print only device-related information: tree root, chunk and
86 device trees
87
88 -r|--roots
89 print only short root node information, ie. the root tree keys
90
91 -R|--backups
92 same as --roots plus print backup root info, ie. the backup
93 root keys and the respective tree root block offset
94
95 -u|--uuid
96 print only the uuid tree information, empty output if the tree
97 does not exist
98
99 -b <block_num>
100 print info of the specified block only
101
102 -t <tree_id>
103 print only the tree with the specified ID, where the ID can be
104 numerical or common name in a flexible human readable form
105
106 The tree id name recognition rules:
107
108 · case does not matter
109
110 · the C source definition, eg. BTRFS_ROOT_TREE_OBJECTID
111
112 · short forms without BTRFS_ prefix, without _TREE and
113 _OBJECTID suffix, eg. ROOT_TREE, ROOT
114
115 · convenience aliases, eg. DEVICE for the DEV tree, CHECKSUM
116 for CSUM
117
118 · unrecognized ID is an error
119
120 inode-resolve [-v] <ino> <path>
121 (needs root privileges)
122
123 resolve paths to all files with given inode number ino in a given
124 subvolume at path, ie. all hardlinks
125
126 Options
127
128 -v
129 verbose mode, print count of returned paths and ioctl() return
130 value
131
132 logical-resolve [-Pv] [-s <bufsize>] <logical> <path>
133 (needs root privileges)
134
135 resolve paths to all files at given logical address in the linear
136 filesystem space
137
138 Options
139
140 -P
141 skip the path resolving and print the inodes instead
142
143 -v
144 verbose mode, print count of returned paths and all ioctl()
145 return values
146
147 -s <bufsize>
148 set internal buffer for storing the file names to bufsize,
149 default is 4096, maximum 64k
150
151 min-dev-size [options] <path>
152 (needs root privileges)
153
154 return the minimum size the device can be shrunk to, without
155 performing any resize operation, this may be useful before
156 executing the actual resize operation
157
158 Options
159
160 --id <id>
161 specify the device id to query, default is 1 if this option is
162 not used
163
164 rootid <path>
165 for a given file or directory, return the containing tree root id,
166 for a subvolume itself return it’s own tree id (ie. subvol id)
167
168 Note
169 The result is undefined for the so-called empty subvolumes
170 (identified by inode number 2), but such subvolume does not
171 contain any files anyway
172
173 subvolid-resolve <subvolid> <path>
174 (needs root privileges)
175
176 resolve the absolute path of a the subvolume id subvolid
177
178 tree-stats [options] <device>
179 (needs root privileges)
180
181 Print sizes and statistics of trees.
182
183 Options
184
185 -b
186 Print raw numbers in bytes.
187
189 btrfs inspect-internal returns a zero exit status if it succeeds. Non
190 zero is returned in case of failure.
191
193 btrfs is part of btrfs-progs. Please refer to the btrfs wiki
194 http://btrfs.wiki.kernel.org for further details.
195
197 mkfs.btrfs(8)
198
199
200
201Btrfs v4.9.1 08/06/2017 BTRFS-INSPECT-INTE(8)