btrfs-progs: extent_io: Init eb->lru to avoid NULL pointer dereference
[platform/upstream/btrfs-progs.git] / Documentation / btrfs-inspect-internal.asciidoc
1 btrfs-inspect-internal(8)
2 =========================
3
4 NAME
5 ----
6 btrfs-inspect-internal - query various internal information
7
8 SYNOPSIS
9 --------
10 *btrfs inspect-internal* <subcommand> <args>
11
12 DESCRIPTION
13 -----------
14
15 This command group provides an interface to query internal information. The
16 functionality ranges from a simple UI to an ioctl or a more complex query that
17 assembles the result from several internal structures. The latter usually
18 requires calls to privileged ioctls.
19
20 SUBCOMMAND
21 ----------
22 *dump-super* [options] <device> [device...]::
23 (replaces the standalone tool *btrfs-show-super*)
24 +
25 Show btrfs superblock information stored on given devices in textual form.
26 By default the first superblock is printed, more details about all copies or
27 additional backup data can be printed.
28 +
29 Besides verification of the filesystem signature, there are no other sanity
30 checks. The superblock checksum status is reported, the device item and
31 filesystem UUIDs are checked and reported.
32 +
33 NOTE: the meaning of option '-s' has changed in version 4.8 to be consistent
34 with other tools to specify superblock copy rather the offset. The old way still
35 works, but prints a warning. Please update your scripts to use '--bytenr'
36 instead. The option '-i' has been deprecated.
37 +
38 `Options`
39 +
40 -f|--full::::
41 print full superblock information, including the system chunk array and backup roots
42 -a|--all::::
43 print information about all present superblock copies (cannot be used together
44 with '-s' option)
45 -i <super>::::
46 (deprecated since 4.8, same behaviour as '--super')
47 --bytenr <bytenr>::::
48 specify offset to a superblock in a non-standard location at 'bytenr', useful
49 for debugging (disables the '-f' option)
50 +
51 If there are multiple options specified, only the last one applies.
52 +
53 -F|--force::::
54 attempt to print the superblock even if a valid BTRFS signature is not found;
55 the result may be completely wrong if the data does not resemble a superblock
56 +
57 -s|--super <bytenr>::::
58 (see compatibility note above)
59 +
60 specify which mirror to print, valid values are 0, 1 and 2 and the superblock
61 must be present on the device with a valid signature, can be used together with
62 '--force'
63
64 *dump-tree* [options] <device>::
65 (replaces the standalone tool *btrfs-debug-tree*)
66 +
67 Dump tree structures from a given device in textual form, expand keys to human
68 readable equivalents where possible.
69 This is useful for analyzing filesystem state or inconsistencies and has
70 a positive educational effect on understanding the internal filesystem structure.
71 +
72 NOTE: contains file names, consider that if you're asked to send the dump for
73 analysis. Does not contain file data.
74 +
75 `Options`
76 +
77 -e|--extents::::
78 print only extent-related information: extent and device trees
79 -d|--device::::
80 print only device-related information: tree root, chunk and device trees
81 -r|--roots::::
82 print only short root node information, ie. the root tree keys
83 -R|--backups::::
84 same as --roots plus print backup root info, ie. the backup root keys and
85 the respective tree root block offset
86 -u|--uuid::::
87 print only the uuid tree information, empty output if the tree does not exist
88 -b <block_num>::::
89 print info of the specified block only
90 --follow::::
91 use with '-b', print all children tree blocks of '<block_num>'
92 -t <tree_id>::::
93 print only the tree with the specified ID, where the ID can be numerical or
94 common name in a flexible human readable form
95 +
96 The tree id name recognition rules:
97 [options="compact"]
98 * case does not matter
99 * the C source definition, eg. BTRFS_ROOT_TREE_OBJECTID
100 * short forms without BTRFS_ prefix, without _TREE and _OBJECTID suffix, eg. ROOT_TREE, ROOT
101 * convenience aliases, eg. DEVICE for the DEV tree, CHECKSUM for CSUM
102 * unrecognized ID is an error
103
104 *inode-resolve* [-v] <ino> <path>::
105 (needs root privileges)
106 +
107 resolve paths to all files with given inode number 'ino' in a given subvolume
108 at 'path', ie. all hardlinks
109 +
110 `Options`
111 +
112 -v::::
113 verbose mode, print count of returned paths and ioctl() return value
114
115 *logical-resolve* [-Pv] [-s <bufsize>] <logical> <path>::
116 (needs root privileges)
117 +
118 resolve paths to all files at given 'logical' address in the linear filesystem space
119 +
120 `Options`
121 +
122 -P::::
123 skip the path resolving and print the inodes instead
124 -v::::
125 verbose mode, print count of returned paths and all ioctl() return values
126 -s <bufsize>::::
127 set internal buffer for storing the file names to 'bufsize', default is 4096, maximum 64k
128
129 *min-dev-size* [options] <path>::
130 (needs root privileges)
131 +
132 return the minimum size the device can be shrunk to, without performing any
133 resize operation, this may be useful before executing the actual resize operation
134 +
135 `Options`
136 +
137 --id <id>::::
138 specify the device 'id' to query, default is 1 if this option is not used
139
140 *rootid* <path>::
141 for a given file or directory, return the containing tree root id, but for a
142 subvolume itself return its own tree id (ie. subvol id)
143 +
144 NOTE: The result is undefined for the so-called empty subvolumes (identified by
145 inode number 2), but such a subvolume does not contain any files anyway
146
147 *subvolid-resolve* <subvolid> <path>::
148 (needs root privileges)
149 +
150 resolve the absolute path of the subvolume id 'subvolid'
151
152 *tree-stats* [options] <device>::
153 (needs root privileges)
154 +
155 Print sizes and statistics of trees.
156 +
157 `Options`
158 +
159 -b::::
160 Print raw numbers in bytes.
161
162 EXIT STATUS
163 -----------
164 *btrfs inspect-internal* returns a zero exit status if it succeeds. Non zero is
165 returned in case of failure.
166
167 AVAILABILITY
168 ------------
169 *btrfs* is part of btrfs-progs.
170 Please refer to the btrfs wiki http://btrfs.wiki.kernel.org for
171 further details.
172
173 SEE ALSO
174 --------
175 `mkfs.btrfs`(8)