btrfs-image(8)

SYNOPSIS 概要 

btrfs-image [options] <source> <target>

DESCRIPTION 描述 

btrfs-image is used to create an image of a btrfs filesystem. All data will be zeroed, but metadata and the like is preserved. Mainly used for debugging purposes.
btrfs-image 用于创建 btrfs 文件系统的镜像。所有数据将被清零,但元数据等将被保留。主要用于调试目的。

In the dump mode, source is the btrfs device/file and target is the output file (use - for stdout).
在转储模式下,source 是 btrfs 设备/文件,target 是输出文件(使用 - 表示标准输出)。

In the restore mode (option -r), source is the dumped image and target is the btrfs device/file.
在恢复模式(选项 -r)中,源是转储的镜像,目标是 btrfs 设备/文件。

OPTIONS 选项 

-r

Restore metadump image. By default, this fixes super’s chunk tree, by using 1 stripe pointing to primary device, so that file system can be restored by running tree log reply if possible. To restore without changing number of stripes in chunk tree check -o option.
恢复 metadump 镜像。默认情况下,这会修复超级块的块树,通过使用指向主设备的 1 条带,以便如果可能的话通过运行树日志回复来恢复文件系统。要在不更改块树中条带数量的情况下恢复,请检查 -o 选项。

-c <value>

Compression level (0 ~ 9).
压缩级别(0 ~ 9)。

-t <value>

Number of threads (1 ~ 32) to be used to process the image dump or restore.
用于处理图像转储或还原的线程数(1 ~ 32)。

-o

Use the old restore method, this does not fixup the chunk tree so the restored file system will not be able to be mounted.
使用旧的还原方法,这不会修复块树,因此无法挂载还原后的文件系统。

-s

Sanitize the file names when generating the image. One -s means just generate random garbage, which means that the directory indexes won’t match up since the hashes won’t match with the garbage filenames. Using -s will calculate a collision for the filename so that the hashes match, and if it can’t calculate a collision then it will just generate garbage. The collision calculator is very time and CPU intensive so only use it if you are having problems with your file system tree and need to have it mostly working.
在生成图像时对文件名进行清理。一个 -s 表示只生成随机垃圾,这意味着目录索引不会匹配,因为哈希值与垃圾文件名不匹配。使用 -s 将为文件名计算碰撞,以使哈希值匹配,如果无法计算碰撞,则只会生成垃圾。碰撞计算器非常耗时且占用 CPU,因此只有在文件系统树出现问题并且需要大部分正常工作时才使用。

-w

Walk all the trees manually and copy any blocks that are referenced. Use this option if your extent tree is corrupted to make sure that all of the metadata is captured.
手动遍历所有树,并复制所有被引用的块。如果您的范围树已损坏,使用此选项可以确保捕获所有元数据。

-m

Restore for multiple devices, more than 1 device should be provided.
为多个设备恢复,应提供多于 1 个设备。

EXIT STATUS 退出状态 

btrfs-image will return 0 if no error happened. If any problems happened, 1 will be returned.
如果没有发生错误,btrfs-image 将返回 0。如果发生任何问题,将返回 1。

SEE ALSO 参见 

mkfs.btrfs(8)