btrfs-progs: docs: update dump-tree
[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-tree* [options] <device>::
23 (may need root privileges to access the device)
24 +
25 Dump tree structures from a given device in textual form, expand keys to human
26 readable equivalents where possible.
27 This is useful for analyzing filesystem state or inconsistencies and has
28 a positive educational effect on understanding the internal filesystem structure.
29 +
30 NOTE: contains file names, consider that if you're asked to send the dump for
31 analysis. Does not contain file data.
32 +
33 `Options`
34 +
35 -e|--extents::::
36 print only extent-related information: extent and device trees
37 -d|--device::::
38 print only device-related information: tree root, chunk and device trees
39 -r|--roots::::
40 print only short root node information, ie. the root tree keys
41 -R|--backups::::
42 same as --roots plus print backup root info, ie. the backup root keys and
43 the respective tree root block offset
44 -u|--uuid::::
45 print only the uuid tree information, empty output if the tree does not exist
46 -b <block_num>::::
47 print info of the specified block only
48 -t <tree_id>::::
49 print only the tree with the specified numerical ID
50
51 *inode-resolve* [-v] <ino> <path>::
52 (needs root privileges)
53 +
54 resolve paths to all files with given inode number 'ino' in a given subvolume
55 at 'path', ie. all hardlinks
56 +
57 `Options`
58 +
59 -v::::
60 verbose mode, print count of returned paths and ioctl() return value
61
62 *logical-resolve* [-Pv] [-s <bufsize>] <logical> <path>::
63 (needs root privileges)
64 +
65 resolve paths to all files at given 'logical' address in the linear filesystem space
66 +
67 `Options`
68 +
69 -P::::
70 skip the path resolving and print the inodes instead
71 -v::::
72 verbose mode, print count of returned paths and all ioctl() return values
73 -s <bufsize>::::
74 set internal buffer for storing the file names to 'bufsize', default is 4096, maximum 64k
75
76 *min-dev-size* [options] <path>::
77 (needs root privileges)
78 +
79 return the minimum size the device can be shrunk to, without performing any
80 resize operation, this may be useful before executing the actual resize operation
81 +
82 `Options`
83 +
84 --id <id>::::
85 specify the device 'id' to query, default is 1 if this option is not used
86
87 *rootid* <path>::
88 for a given file or directory, return the containing tree root id, for a
89 subvolume itself return it's own tree id (ie. subvol id)
90 +
91 NOTE: The result is undefined for the so-called empty subvolumes (identified by
92 inode number 2), but such subvolume does not contain any files anyway
93
94 *show-super* [options] <device> [device...]::
95 (needs root privileges)
96 +
97 Show btrfs superblock information stored in devices.
98 It is used to print the information of superblock,
99 you can specify which mirror to print out.
100 +
101 By default, every device's first superblock will be printed out.
102 +
103 Mainly used for debug purpose.
104 +
105 `Options`
106 +
107 -f::::
108 Print full superblock information.
109 +
110 Including the system chunk array and backup roots.
111 +
112 -a::::
113 Print information of all superblocks.
114 +
115 If this option is given, '-i' option will be ignored.
116 +
117 -i <super_mirror>::::
118 Specify which mirror to print out.
119 +
120 <super_mirror> is between 0 and 2.
121 If several '-i <super_mirror>' are given, only the last one is valid.
122 +
123 -F::::
124 Attempt to print the superblock even if no superblock magic is found.  May end
125 badly.
126 -s <bytenr>::::
127 specifiy offset to a superblock in a non-standard location at 'bytenr', useful
128 for debugging (disables the '-f' option)
129
130 *subvolid-resolve* <subvolid> <path>::
131 (needs root privileges)
132 +
133 resolve the absolute path of a the subvolume id 'subvolid'
134
135 EXIT STATUS
136 -----------
137 *btrfs inspect-internal* returns a zero exit status if it succeeds. Non zero is
138 returned in case of failure.
139
140 AVAILABILITY
141 ------------
142 *btrfs* is part of btrfs-progs.
143 Please refer to the btrfs wiki http://btrfs.wiki.kernel.org for
144 further details.
145
146 SEE ALSO
147 --------
148 `mkfs.btrfs`(8),
149 `btrfs-debug-tree`(8)