|
|
(One intermediate revision by one user not shown) |
Line 1: |
Line 1: |
− | =btrfs-inspect-internal(8) manual page=
| |
| {{GeneratedManpage | | {{GeneratedManpage |
| |name=btrfs-inspect-internal}} | | |name=btrfs-inspect-internal}} |
− |
| |
− | ==NAME==
| |
− | btrfs-inspect-internal - query various internal information
| |
− |
| |
− | ==SYNOPSIS==
| |
− |
| |
− | <p><b>btrfs inspect-internal</b> <em><subcommand></em> <em><args></em></p>
| |
− | ==DESCRIPTION==
| |
− |
| |
− | <p>This command group provides an interface to query internal information. The
| |
− | functionality ranges from a simple UI to an ioctl or a more complex query that
| |
− | assembles the result from several internal structures. The latter usually
| |
− | requires calls to privileged ioctls.</p>
| |
− | ==SUBCOMMAND==
| |
− |
| |
− | <dl>
| |
− | <dt>
| |
− | <b>dump-super</b> [options] <em><device></em> [device…]
| |
− | <dd>
| |
− | <p>
| |
− | (replaces the standalone tool <b>btrfs-show-super</b>)
| |
− | </p>
| |
− | <p>Show btrfs superblock information stored on given devices in textual form.
| |
− | By default the first superblock is printed, more details about all copies or
| |
− | additional backup data can be printed.</p>
| |
− | <p>Besides verification of the filesystem signature, there are no other sanity
| |
− | checks. The superblock checksum status is reported, the device item and
| |
− | filesystem UUIDs are checked and reported.</p>
| |
− | <blockquote><b>Note:</b>
| |
− | the meaning of option <em>-s</em> has changed in version 4.8 to be consistent
| |
− | with other tools to specify superblock copy rather the offset. The old way still
| |
− | works, but prints a warning. Please update your scripts to use <em>--bytenr</em>
| |
− | instead. The option <em>-i</em> has been deprecated.</blockquote>
| |
− | <p><tt>Options</tt></p>
| |
− | <dl>
| |
− | <dt>
| |
− | -f|--full
| |
− | <dd>
| |
− | <p>
| |
− | print full superblock information, including the system chunk array and backup roots
| |
− | </p>
| |
− |
| |
− | <dt>
| |
− | -a|--all
| |
− | <dd>
| |
− | <p>
| |
− | print information about all present superblock copies (cannot be used together
| |
− | with <em>-s</em> option)
| |
− | </p>
| |
− |
| |
− | <dt>
| |
− | -i <em><super></em>
| |
− | <dd>
| |
− | <p>
| |
− | (deprecated since 4.8, same behaviour as <em>--super</em>)
| |
− | </p>
| |
− |
| |
− | <dt>
| |
− | --bytenr <em><bytenr></em>
| |
− | <dd>
| |
− | <p>
| |
− | specify offset to a superblock in a non-standard location at <em>bytenr</em>, useful
| |
− | for debugging (disables the <em>-f</em> option)
| |
− | </p>
| |
− | <p>If there are multiple options specified, only the last one applies.</p>
| |
− |
| |
− | <dt>
| |
− | -F|--force
| |
− | <dd>
| |
− | <p>
| |
− | attempt to print the superblock even if a valid BTRFS signature is not found;
| |
− | the result may be completely wrong if the data does not resemble a superblock
| |
− | </p>
| |
− |
| |
− | <dt>
| |
− | -s|--super <em><bytenr></em>
| |
− | <dd>
| |
− | <p>
| |
− | (see compatibility note above)
| |
− | </p>
| |
− | <p>specify which mirror to print, valid values are 0, 1 and 2 and the superblock
| |
− | must be present on the device with a valid signature, can be used together with
| |
− | <em>--force</em></p>
| |
− |
| |
− | </dl>
| |
− |
| |
− | <dt>
| |
− | <b>dump-tree</b> [options] <em><device></em> [device…]
| |
− | <dd>
| |
− | <p>
| |
− | (replaces the standalone tool <b>btrfs-debug-tree</b>)
| |
− | </p>
| |
− | <p>Dump tree structures from a given device in textual form, expand keys to human
| |
− | readable equivalents where possible.
| |
− | This is useful for analyzing filesystem state or inconsistencies and has
| |
− | a positive educational effect on understanding the internal filesystem structure.</p>
| |
− | <blockquote><b>Note:</b>
| |
− | contains file names, consider that if you’re asked to send the dump for
| |
− | analysis. Does not contain file data.</blockquote>
| |
− | <p><tt>Options</tt></p>
| |
− | <dl>
| |
− | <dt>
| |
− | -e|--extents
| |
− | <dd>
| |
− | <p>
| |
− | print only extent-related information: extent and device trees
| |
− | </p>
| |
− |
| |
− | <dt>
| |
− | -d|--device
| |
− | <dd>
| |
− | <p>
| |
− | print only device-related information: tree root, chunk and device trees
| |
− | </p>
| |
− |
| |
− | <dt>
| |
− | -r|--roots
| |
− | <dd>
| |
− | <p>
| |
− | print only short root node information, ie. the root tree keys
| |
− | </p>
| |
− |
| |
− | <dt>
| |
− | -R|--backups
| |
− | <dd>
| |
− | <p>
| |
− | same as --roots plus print backup root info, ie. the backup root keys and
| |
− | the respective tree root block offset
| |
− | </p>
| |
− |
| |
− | <dt>
| |
− | -u|--uuid
| |
− | <dd>
| |
− | <p>
| |
− | print only the uuid tree information, empty output if the tree does not exist
| |
− | </p>
| |
− |
| |
− | <dt>
| |
− | -b <em><block_num></em>
| |
− | <dd>
| |
− | <p>
| |
− | print info of the specified block only, can be specified multiple times
| |
− | </p>
| |
− |
| |
− | <dt>
| |
− | --follow
| |
− | <dd>
| |
− | <p>
| |
− | use with <em>-b</em>, print all children tree blocks of <em><em><block_num></em></em>
| |
− | </p>
| |
− |
| |
− | <dt>
| |
− | --dfs
| |
− | <dd>
| |
− | <p>
| |
− | (default up to 5.2)
| |
− | </p>
| |
− | <p>use depth-first search to print trees, the nodes and leaves are
| |
− | intermixed in the output
| |
− | --bfs::::
| |
− | (default since 5.3)</p>
| |
− | <p>use breadth-first search to print trees, the nodes are printed before all
| |
− | leaves
| |
− | --noscan::::
| |
− | do not automatically scan the system for other devices from the same
| |
− | filesystem, only use the devices provided as the arguments
| |
− | -t <em><tree_id></em>::::
| |
− | print only the tree with the specified ID, where the ID can be numerical or
| |
− | common name in a flexible human readable form</p>
| |
− | <p>The tree id name recognition rules:</p>
| |
− | <ul>
| |
− | <li>
| |
− | <p>
| |
− | case does not matter
| |
− | </p>
| |
− | </li>
| |
− | <li>
| |
− | <p>
| |
− | the C source definition, eg. BTRFS_ROOT_TREE_OBJECTID
| |
− | </p>
| |
− | </li>
| |
− | <li>
| |
− | <p>
| |
− | short forms without BTRFS_ prefix, without _TREE and _OBJECTID suffix, eg. ROOT_TREE, ROOT
| |
− | </p>
| |
− | </li>
| |
− | <li>
| |
− | <p>
| |
− | convenience aliases, eg. DEVICE for the DEV tree, CHECKSUM for CSUM
| |
− | </p>
| |
− | </li>
| |
− | <li>
| |
− | <p>
| |
− | unrecognized ID is an error
| |
− | </p>
| |
− | </li>
| |
− | </ul>
| |
− |
| |
− | </dl>
| |
− |
| |
− | <dt>
| |
− | <b>inode-resolve</b> [-v] <em><ino></em> <em><path></em>
| |
− | <dd>
| |
− | <p>
| |
− | (needs root privileges)
| |
− | </p>
| |
− | <p>resolve paths to all files with given inode number <em>ino</em> in a given subvolume
| |
− | at <em>path</em>, ie. all hardlinks</p>
| |
− | <p><tt>Options</tt></p>
| |
− | <dl>
| |
− | <dt>
| |
− | -v
| |
− | <dd>
| |
− | <p>
| |
− | verbose mode, print count of returned paths and ioctl() return value
| |
− | </p>
| |
− |
| |
− | </dl>
| |
− |
| |
− | <dt>
| |
− | <b>logical-resolve</b> [-Pvo] [-s <em><bufsize></em>] <em><logical></em> <em><path></em>
| |
− | <dd>
| |
− | <p>
| |
− | (needs root privileges)
| |
− | </p>
| |
− | <p>resolve paths to all files at given <em>logical</em> address in the linear filesystem space</p>
| |
− | <p><tt>Options</tt></p>
| |
− | <dl>
| |
− | <dt>
| |
− | -P
| |
− | <dd>
| |
− | <p>
| |
− | skip the path resolving and print the inodes instead
| |
− | </p>
| |
− |
| |
− | <dt>
| |
− | -v
| |
− | <dd>
| |
− | <p>
| |
− | verbose mode, print count of returned paths and all ioctl() return values
| |
− | </p>
| |
− |
| |
− | <dt>
| |
− | -o
| |
− | <dd>
| |
− | <p>
| |
− | ignore offsets, find all references to an extent instead of a single block.
| |
− | Requires kernel support for the V2 ioctl (added in 4.15). The results might need
| |
− | further processing to filter out unwanted extents by the offset that is supposed
| |
− | to be obtained by other means.
| |
− | </p>
| |
− |
| |
− | <dt>
| |
− | -s <em><bufsize></em>
| |
− | <dd>
| |
− | <p>
| |
− | set internal buffer for storing the file names to <em>bufsize</em>, default is 64k,
| |
− | maximum 16m. Buffer sizes over 64K require kernel support for the V2 ioctl
| |
− | (added in 4.15).
| |
− | </p>
| |
− |
| |
− | </dl>
| |
− |
| |
− | <dt>
| |
− | <b>min-dev-size</b> [options] <em><path></em>
| |
− | <dd>
| |
− | <p>
| |
− | (needs root privileges)
| |
− | </p>
| |
− | <p>return the minimum size the device can be shrunk to, without performing any
| |
− | resize operation, this may be useful before executing the actual resize operation</p>
| |
− | <p><tt>Options</tt></p>
| |
− | <dl>
| |
− | <dt>
| |
− | --id <em><id></em>
| |
− | <dd>
| |
− | <p>
| |
− | specify the device <em>id</em> to query, default is 1 if this option is not used
| |
− | </p>
| |
− |
| |
− | </dl>
| |
− |
| |
− | <dt>
| |
− | <b>rootid</b> <em><path></em>
| |
− | <dd>
| |
− | <p>
| |
− | for a given file or directory, return the containing tree root id, but for a
| |
− | subvolume itself return its own tree id (ie. subvol id)
| |
− | </p>
| |
− | <blockquote><b>Note:</b>
| |
− | The result is undefined for the so-called empty subvolumes (identified by
| |
− | inode number 2), but such a subvolume does not contain any files anyway</blockquote>
| |
− |
| |
− | <dt>
| |
− | <b>subvolid-resolve</b> <em><subvolid></em> <em><path></em>
| |
− | <dd>
| |
− | <p>
| |
− | (needs root privileges)
| |
− | </p>
| |
− | <p>resolve the absolute path of the subvolume id <em>subvolid</em></p>
| |
− |
| |
− | <dt>
| |
− | <b>tree-stats</b> [options] <em><device></em>
| |
− | <dd>
| |
− | <p>
| |
− | (needs root privileges)
| |
− | </p>
| |
− | <p>Print sizes and statistics of trees.</p>
| |
− | <p><tt>Options</tt></p>
| |
− | <dl>
| |
− | <dt>
| |
− | -b
| |
− | <dd>
| |
− | <p>
| |
− | Print raw numbers in bytes.
| |
− | </p>
| |
− |
| |
− | </dl>
| |
− |
| |
− | </dl>
| |
− | ==EXIT STATUS==
| |
− |
| |
− | <p><b>btrfs inspect-internal</b> returns a zero exit status if it succeeds. Non zero is
| |
− | returned in case of failure.</p>
| |
− | ==AVAILABILITY==
| |
− |
| |
− | <p><b>btrfs</b> is part of btrfs-progs.
| |
− | Please refer to the btrfs wiki http://btrfs.wiki.kernel.org for
| |
− | further details.</p>
| |
− | ==SEE ALSO==
| |
− |
| |
− | <p>[[Manpage/mkfs.btrfs|mkfs.btrfs(8)]]</p>
| |
− | [[Category:Manpage]]
| |