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