btrfs-progs: update docs and completion for inspect-internal 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 (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 *subvolid-resolve* <subvolid> <path>::
91 (needs root privileges)
92 +
93 resolve the absolute path of a the subvolume id 'subvolid'
94
95 EXIT STATUS
96 -----------
97 *btrfs inspect-internal* returns a zero exit status if it succeeds. Non zero is
98 returned in case of failure.
99
100 AVAILABILITY
101 ------------
102 *btrfs* is part of btrfs-progs.
103 Please refer to the btrfs wiki http://btrfs.wiki.kernel.org for
104 further details.
105
106 SEE ALSO
107 --------
108 `mkfs.btrfs`(8),
109 `btrfs-debug-tree`(8)