btrfs-inspect-internal(8)

SYNOPSIS 概要 

btrfs inspect-internal <subcommand> <args>

DESCRIPTION 描述 

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.
此命令组提供了一个查询内部信息的接口。功能范围从简单的 UI 到 ioctl,或者是从几个内部结构中组装结果的更复杂查询。后者通常需要调用特权 ioctls。

SUBCOMMAND 子命令 

dump-super [options] <device> [device…]

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.
在给定设备上以文本形式显示存储的 btrfs 超级块信息。默认情况下,会打印第一个超级块,可以打印有关所有副本或其他备份数据的更多详细信息。

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.
除了验证文件系统签名之外,没有其他健全性检查。报告超级块校验和状态,检查并报告设备项和文件系统 UUID。

Note 注意

The meaning of option -s 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 --bytenr instead. The option -i has been deprecated.
选项 -s 的含义在版本 4.8 中已更改,以与其他工具保持一致,用于指定超级块副本而不是偏移量。旧方式仍然有效,但会打印警告。请更新您的脚本以使用 --bytenr。选项 -i 已被弃用。

Options

-f|--full -f|--完整

print full superblock information, including the system chunk array and backup roots
打印完整的超级块信息,包括系统块数组和备份根

-a|--all -a|--全部

print information about all present superblock copies (cannot be used together with -s option)
打印有关所有当前超级块副本的信息(不能与 -s 选项一起使用)

-i <super>

(deprecated since 4.8, same behaviour as --super)
(自 4.8 版本起已弃用,与 --super 具有相同行为)

--bytenr <bytenr>

specify offset to a superblock in a non-standard location at bytenr, useful for debugging (disables the -f option)
指定超级块在非标准位置的偏移量为 bytenr,用于调试(禁用 -f 选项)

If there are multiple options specified, only the last one applies.
如果指定了多个选项,则只应用最后一个。

-F|--force

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
即使未找到有效的 BTRFS 签名,也尝试打印超级块;如果数据不像超级块,则结果可能完全错误。

-s|--super <bytenr> -s|--超级 <字节编号>

(see compatibility note above)
(请参阅上面的兼容性说明)

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 --force
指定要打印的镜像,有效值为 0、1 和 2,超级块必须存在于具有有效签名的设备上,可以与--force 一起使用

dump-tree [options] <device> [device…]
转储树 [选项] <设备> [设备...]

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.
以文本形式从给定设备转储树结构,尽可能将键扩展为人类可读的等效形式。这对于分析文件系统状态或不一致性非常有用,并对理解内部文件系统结构有积极的教育作用。

Note 注意

Contains file names, consider that if you’re asked to send the dump for analysis. Does not contain file data.
包含文件名,请考虑如果要求您发送转储进行分析。不包含文件数据。

Options

-e|--extents -e|--范围

print only extent-related information: extent and device trees
仅打印与范围相关的信息:范围和设备树

-d|--device -d|--设备

print only device-related information: tree root, chunk and device trees
仅打印与设备相关的信息:树根、块和设备树

-r|--roots

print only short root node information, i.e. the root tree keys
仅打印简短的根节点信息,即根树键

-R|--backups -R|--备份

same as --roots plus print backup root info, i.e. the backup root keys and the respective tree root block offset
与 --roots 相同,另外打印备份根信息,即备份根密钥和相应的树根块偏移量

-u|--uuid

print only the uuid tree information, empty output if the tree does not exist
仅打印 UUID 树信息,如果树不存在则输出为空

-b <block_num>

print info of the specified block only, can be specified multiple times
仅打印指定块的信息,可以多次指定

--follow

use with -b, print all children tree blocks of <block_num>
与 -b 一起使用,打印 <block_num> 的所有子树块

--dfs

(default up to 5.2)
(默认为 5.2 版本)

use depth-first search to print trees, the nodes and leaves are intermixed in the output
使用深度优先搜索来打印树,节点和叶子在输出中交错显示

--bfs

(default since 5.3) (默认为 5.3 版本)

use breadth-first search to print trees, the nodes are printed before all leaves
使用广度优先搜索来打印树,节点在所有叶子节点之前打印

--hide-names

print a placeholder HIDDEN instead of various names, useful for developers to inspect the dump while keeping potentially sensitive information hidden
打印一个占位符 HIDDEN 而不是各种名称,有助于开发人员检查转储时保持潜在敏感信息隐藏

This is: 这是:

  • directory entries (files, directories, subvolumes)
    目录条目(文件,目录,子卷)

  • default subvolume 默认子卷。

  • extended attributes (name, value)
    扩展属性(名称,值)

  • hardlink names (if stored inside another item or as extended references in standalone items)
    硬链接名称(如果存储在另一个项目内部或作为独立项目中的扩展引用)

Note 注意

Lengths are not hidden because they can be calculated from the item size anyway.
长度不会被隐藏,因为它们可以从项目大小中计算出来。

--csum-headers

print b-tree node checksums stored in headers (metadata)
打印存储在头部(元数据)中的 B 树节点校验和。

--csum-items

print checksums stored in checksum items (data)
打印存储在校验项(数据)中的校验和。

--noscan

do not automatically scan the system for other devices from the same filesystem, only use the devices provided as the arguments
不要自动扫描系统中来自相同文件系统的其他设备,只使用作为参数提供的设备

-t <tree_id>

print only the tree with the specified ID, where the ID can be numerical or common name in a flexible human readable form
仅打印具有指定 ID 的树,其中 ID 可以是数字或以灵活易读的形式表示的通用名称

The tree id name recognition rules:
树 ID 名称识别规则:

  • case does not matter 案例不重要

  • the C source definition, e.g. BTRFS_ROOT_TREE_OBJECTID
    C 源定义,例如 BTRFS_ROOT_TREE_OBJECTID

  • short forms without BTRFS_ prefix, without _TREE and _OBJECTID suffix, e.g. ROOT_TREE, ROOT
    不带 BTRFS_前缀的简写形式,不带_TREE 和_OBJECTID 后缀,例如 ROOT_TREE,ROOT

  • convenience aliases, e.g. DEVICE for the DEV tree, CHECKSUM for CSUM
    方便的别名,例如 DEV 树的 DEVICE,CSUM 的 CHECKSUM

  • unrecognized ID is an error
    未识别的 ID 是一个错误

inode-resolve [-v] <ino> <path>

(needs root privileges) (需要 root 权限)

resolve paths to all files with given inode number ino in a given subvolume at path, i.e. all hardlinks
解析给定子卷中具有给定 inode 号 ino 的所有文件的路径,即所有硬链接

Options

-v

(deprecated) alias for global -v option
(已弃用)全局 -v 选项的别名

logical-resolve [-Pvo] [-s <bufsize>] <logical> <path>
逻辑解析 [-Pvo] [-s <bufsize>] <logical> <path>

(needs root privileges) (需要 root 权限)

resolve paths to all files at given logical address in the linear filesystem space
在线性文件系统空间中,解析给定逻辑地址的所有文件路径

Options

-P

skip the path resolving and print the inodes instead
跳过路径解析,而是打印 i 节点

-o

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.
忽略偏移量,查找对一个范围的所有引用,而不是单个块。需要内核支持 V2 ioctl(在 4.15 版本中添加)。结果可能需要进一步处理,以通过其他方式获取的偏移量来过滤掉不需要的范围。

-s <bufsize>

set internal buffer for storing the file names to bufsize, default is 64KiB, maximum 16MiB. Buffer sizes over 64Kib require kernel support for the V2 ioctl (added in 4.15).
设置用于存储文件名的内部缓冲区大小为 bufsize,默认为 64KiB,最大为 16MiB。超过 64KiB 的缓冲区大小需要内核支持 V2 ioctl(在 4.15 版本中添加)。

-v

(deprecated) alias for global -v option
(已弃用)全局 -v 选项的别名

map-swapfile [options] <file>
map-swapfile [选项] <文件>

(needs root privileges) (需要 root 权限)

Find device-specific physical offset of file that can be used for hibernation. Also verify that the file is suitable as a swapfile. See also command btrfs filesystem mkswapfile and the Swapfile feature description.
查找可用于休眠的文件的设备特定物理偏移量。还要验证该文件是否适用作为交换文件。另请参阅 btrfs 文件系统 mkswapfile 命令和交换文件功能描述。

Note 注意

Do not use filefrag or FIEMAP ioctl values reported as physical, this is different due to internal filesystem mappings. The hibernation expects offset relative to the physical block device.
不要使用 filefrag 或 FIEMAP ioctl 报告的物理值,这是由于内部文件系统映射不同。休眠期望相对于物理块设备的偏移量。

Options

-r|--resume-offset -r|--恢复偏移

print only the value suitable as resume offset for file /sys/power/resume_offset
仅打印适合作为文件/sys/power/resume_offset 的恢复偏移值

min-dev-size [options] <path>
min-dev-size [选项] <路径>

(needs root privileges) (需要 root 权限)

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
返回设备可以缩小到的最小尺寸,而不执行任何调整操作,这在执行实际调整操作之前可能很有用

Options

--id <id>

specify the device id to query, default is 1 if this option is not used
指定要查询的设备 ID,默认为 1,如果不使用此选项

rootid <path> 根 ID <路径>

for a given file or directory, return the containing tree root id, but for a subvolume itself return its own tree id (i.e. subvol id)
对于给定的文件或目录,返回包含树根 ID,但对于子卷本身返回其自己的树 ID(即子卷 ID)

Note 注意

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
对于所谓的空子卷(由 inode 号 2 标识),结果是未定义的,但这样的子卷无论如何都不包含任何文件

subvolid-resolve <subvolid> <path>
解析子卷标识符 <subvolid> <path>

(needs root privileges) (需要 root 权限)

resolve the absolute path of the subvolume id subvolid
解析子卷标识符 subvolid 的绝对路径

tree-stats [options] <device>
树状统计 [选项] <设备>

(needs root privileges) (需要 root 权限)

Print sizes and statistics of trees. This takes a device as an argument and not a mount point unlike other commands.
打印树的大小和统计信息。与其他命令不同,这需要一个设备作为参数,而不是挂载点。

Note 注意

In case the the filesystem is still mounted it’s possible to run the command but the results may be inaccurate or various errors may be printed in case there are ongoing writes to the filesystem. A warning is printed in such case.
如果文件系统仍然挂载,可以运行该命令,但结果可能不准确,或者在文件系统有正在进行的写操作时可能会打印各种错误。在这种情况下会打印警告。

Options

-b

Print raw numbers in bytes.
以字节形式打印原始数字。

EXIT STATUS 退出状态 

btrfs inspect-internal returns a zero exit status if it succeeds. Non zero is returned in case of failure.
如果成功,btrfs inspect-internal 返回零退出状态。失败时返回非零值。

AVAILABILITY 可用性 

btrfs is part of btrfs-progs. Please refer to the documentation at https://btrfs.readthedocs.io.
btrfs 是 btrfs-progs 的一部分。请参考 https://btrfs.readthedocs.io 上的文档。

SEE ALSO 参见 

mkfs.btrfs(8)