btrfs-progs: docs: update btrfs manual page
[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 verifictaion 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 `Options`
34 +
35 -f|--full::::
36 print full superblock information, including the system chunk array and backup roots
37 -a|--all::::
38 print information about all present superblock copies (cannot be used together with '-i' option)
39 -i <super_mirror>::::
40 specify which mirror to print, valid values are 0, 1 and 2 and the superblock must be present on the device
41 +
42 If there are multiple options specified, only the last one is applies.
43 +
44 -F|--force::::
45 attempt to print the superblock even if thre's no valid BTRFS signature found
46 +
47 The result may be completely wrong if the data do not resemble a superblock.
48 +
49 -s <bytenr>::::
50 specify offset to a superblock in a non-standard location at 'bytenr', useful
51 for debugging (disables the '-f' option)
52
53 *dump-tree* [options] <device>::
54 (replaces the standalone tool *btrfs-debug-tree*)
55 +
56 Dump tree structures from a given device in textual form, expand keys to human
57 readable equivalents where possible.
58 This is useful for analyzing filesystem state or inconsistencies and has
59 a positive educational effect on understanding the internal filesystem structure.
60 +
61 NOTE: contains file names, consider that if you're asked to send the dump for
62 analysis. Does not contain file data.
63 +
64 `Options`
65 +
66 -e|--extents::::
67 print only extent-related information: extent and device trees
68 -d|--device::::
69 print only device-related information: tree root, chunk and device trees
70 -r|--roots::::
71 print only short root node information, ie. the root tree keys
72 -R|--backups::::
73 same as --roots plus print backup root info, ie. the backup root keys and
74 the respective tree root block offset
75 -u|--uuid::::
76 print only the uuid tree information, empty output if the tree does not exist
77 -b <block_num>::::
78 print info of the specified block only
79 -t <tree_id>::::
80 print only the tree with the specified ID, where the ID can be numerical or
81 common name in a flexible human readable form
82 +
83 The tree id name recognition rules:
84 [options="compact"]
85 * case does not matter
86 * the C source definition, eg. BTRFS_ROOT_TREE_OBJECTID
87 * short forms without BTRFS_ prefix, without _TREE and _OBJECTID suffix, eg. ROOT_TREE, ROOT
88 * convenience aliases, eg. DEVICE for the DEV tree, CHECKSUM for CSUM
89 * unrecognized ID is an error
90
91 *inode-resolve* [-v] <ino> <path>::
92 (needs root privileges)
93 +
94 resolve paths to all files with given inode number 'ino' in a given subvolume
95 at 'path', ie. all hardlinks
96 +
97 `Options`
98 +
99 -v::::
100 verbose mode, print count of returned paths and ioctl() return value
101
102 *logical-resolve* [-Pv] [-s <bufsize>] <logical> <path>::
103 (needs root privileges)
104 +
105 resolve paths to all files at given 'logical' address in the linear filesystem space
106 +
107 `Options`
108 +
109 -P::::
110 skip the path resolving and print the inodes instead
111 -v::::
112 verbose mode, print count of returned paths and all ioctl() return values
113 -s <bufsize>::::
114 set internal buffer for storing the file names to 'bufsize', default is 4096, maximum 64k
115
116 *min-dev-size* [options] <path>::
117 (needs root privileges)
118 +
119 return the minimum size the device can be shrunk to, without performing any
120 resize operation, this may be useful before executing the actual resize operation
121 +
122 `Options`
123 +
124 --id <id>::::
125 specify the device 'id' to query, default is 1 if this option is not used
126
127 *rootid* <path>::
128 for a given file or directory, return the containing tree root id, for a
129 subvolume itself return it's own tree id (ie. subvol id)
130 +
131 NOTE: The result is undefined for the so-called empty subvolumes (identified by
132 inode number 2), but such subvolume does not contain any files anyway
133
134 *subvolid-resolve* <subvolid> <path>::
135 (needs root privileges)
136 +
137 resolve the absolute path of a the subvolume id 'subvolid'
138
139 *tree-stats* [options] <device>::
140 (needs root privileges)
141 +
142 Print sizes and statistics of trees.
143 +
144 `Options`
145 +
146 -b::::
147 Print raw numbers in bytes.
148
149 EXIT STATUS
150 -----------
151 *btrfs inspect-internal* returns a zero exit status if it succeeds. Non zero is
152 returned in case of failure.
153
154 AVAILABILITY
155 ------------
156 *btrfs* is part of btrfs-progs.
157 Please refer to the btrfs wiki http://btrfs.wiki.kernel.org for
158 further details.
159
160 SEE ALSO
161 --------
162 `mkfs.btrfs`(8)