btrfstune(8)

SYNOPSIS 概要 

btrfstune [options] <device> [<device>…]
btrfstune [选项] <设备> [<设备>…]

DESCRIPTION 描述 

btrfstune can be used to enable, disable, or set various filesystem parameters. The filesystem must be unmounted.
btrfstune 可用于启用、禁用或设置各种文件系统参数。文件系统必须卸载。

The common use case is to enable features that were not enabled at mkfs time. Please make sure that you have kernel support for the features. You can find a complete list of features and kernel version of their introduction at Feature by version page. Also, the manual page mkfs.btrfs(8) contains more details about the features.
常见用例是在 mkfs 时未启用的功能。请确保您的内核支持这些功能。您可以在版本特性页面上找到功能和内核版本介绍的完整列表。此外,手册页 mkfs.btrfs(8) 包含有关这些功能的更多详细信息。

Some of the features could be also enabled on a mounted filesystem by other means. Please refer to the FILESYSTEM FEATURES in btrfs(5).
一些功能也可以通过其他方式在已挂载的文件系统上启用。请参阅 btrfs(5) 中的文件系统功能。

OPTIONS 选项 

--convert-to-block-group-tree

(since kernel 6.1) (自内核 6.1 起)

Convert portions of extent tree that tracks block groups to a separate block group tree. This greatly reduces mount time. Can be also enabled at mkfs time.
将跟踪块组的范围树的部分转换为单独的块组树。这将大大减少挂载时间。也可以在 mkfs 时启用。

--convert-from-block-group-tree

(since kernel 6.1) (自内核 6.1 起)

Convert block groups tracked in standalone block group tree back to extent tree and remove block-group-tree feature bit from the filesystem.
将独立块组树中跟踪的块组转换回范围树,并从文件系统中删除块组树功能位。

--convert-to-free-space-tree

(since kernel 4.5) (自内核 4.5 起)

Convert to free-space-tree feature (v2 of space cache).
转换为自由空间树功能(空间缓存的第二版)。

-f

Allow dangerous changes, e.g. clear the seeding flag or change fsid. Make sure that you are aware of the dangers.
允许危险更改,例如清除播种标志或更改 fsid。确保您意识到危险。

-m

(since kernel: 5.0) (自内核版本:5.0 起)

change fsid stored as metadata_uuid to a randomly generated UUID, see also -U
将存储为 metadata_uuid 的 fsid 更改为随机生成的 UUID,另请参阅 -U

-M <UUID>

(since kernel: 5.0) (自内核版本:5.0 起)

change fsid stored as metadata_uuid to a given UUID, see also -U
将存储为 metadata_uuid 的 fsid 更改为给定的 UUID,另请参阅 -U

The metadata_uuid is stored only in the superblock and is a backward incompatible change. The fsid in metadata blocks remains unchanged and is not overwritten, thus the whole operation is significantly faster than -U.
metadata_uuid 仅存储在超级块中,这是一个不向后兼容的更改。元数据块中的 fsid 保持不变,不会被覆盖,因此整个操作比 -U 快得多。

The new metadata_uuid can be used for mount by UUID and is also used to identify devices of a multi-device filesystem.
新的 metadata_uuid 可用于按 UUID 挂载,并且还用于识别多设备文件系统的设备。

-n

(since kernel: 3.14) (自内核版本:3.14 起)

Enable no-holes feature (more efficient representation of file holes), enabled by mkfs feature no-holes.
启用无洞特性(更高效的文件洞表示),由 mkfs 特性 no-holes 启用。

-r

(since kernel: 3.7) (自内核版本:3.7 起)

Enable extended inode refs (hardlink limit per file in a directory is 65536), enabled by mkfs feature extref.
启用扩展索引引用(目录中每个文件的硬链接限制为 65536),由 mkfs 功能 extref 启用。

-S <0|1>

Enable seeding on a given device. Value 1 will enable seeding, 0 will disable it. A seeding filesystem is forced to be mounted read-only. A new device can be added to the filesystem and will capture all writes keeping the seeding device intact. See also section SEEDING DEVICE in btrfs(5).
在给定设备上启用种子。值 1 将启用种子,值 0 将禁用它。种子文件系统被强制以只读方式挂载。可以向文件系统添加新设备,并捕获所有写入,保持种子设备完整。另请参阅 btrfs(5)中的 SEEDING DEVICE 部分。

Warning 警告

Clearing the seeding flag on a device may be dangerous. If a previously-seeding device is changed, all filesystems that used that device will become unmountable. Setting the seeding flag back will not fix that.
清除设备上的种子标志可能是危险的。如果先前的种子设备发生更改,使用该设备的所有文件系统将变得无法挂载。将种子标志设置回去将无法修复这个问题。

A valid usecase is seeding device as a base image. Clear the seeding flag, update the filesystem and make it seeding again, provided that it’s OK to throw away all filesystems built on top of the previous base.
一个有效的用例是将设备作为基础镜像进行种子化。清除种子标志,更新文件系统并再次进行种子化,前提是可以丢弃在之前基础上构建的所有文件系统。

-u

Change fsid to a randomly generated UUID or continue previous fsid change operation in case it was interrupted.
将 fsid 更改为随机生成的 UUID,或者继续之前的 fsid 更改操作(如果被中断)。

-U <UUID>

Change fsid to UUID in all metadata blocks.
在所有元数据块中将 fsid 更改为 UUID。

The UUID should be a 36 bytes string in printf(3) format %08x-%04x-%04x-%04x-%012x. If there is a previous unfinished fsid change, it will continue only if the UUID matches the unfinished one or if you use the option -u.
UUID 应该是一个 36 字节的字符串,格式为 printf(3) %08x-%04x-%04x-%04x-%012x 。如果有之前未完成的 fsid 更改,只有当 UUID 与未完成的 UUID 匹配或者使用 -u 选项时,它才会继续。

All metadata blocks are rewritten, this may take some time, but the final filesystem compatibility is unaffected, unlike -M.
所有的元数据块都会被重写,这可能需要一些时间,但最终的文件系统兼容性不受影响,不像 -M。

Warning 警告

Cancelling or interrupting a UUID change operation will make the filesystem temporarily unmountable. To fix it, rerun btrfstune -u and let it complete.
取消或中断 UUID 更改操作将使文件系统暂时无法挂载。要修复它,请重新运行 btrfstune -u 并让其完成。

-x

(since kernel: 3.10) (自内核版本:3.10 起)

Enable skinny metadata extent refs (more efficient representation of extents), enabled by mkfs feature skinny-metadata.
启用瘦元数据范围引用(范围更有效的表示),由 mkfs 功能 skinny-metadata 启用。

All newly created extents will use the new representation. To completely switch the entire filesystem, run a full balance of the metadata. Please refer to btrfs-balance(8).
所有新创建的范围将使用新的表示。要完全切换整个文件系统,请运行元数据的完整平衡。请参考 btrfs-balance(8)。

EXIT STATUS 退出状态 

btrfstune returns 0 if no error happened, 1 otherwise.
如果没有发生错误,btrfstune 返回 0,否则返回 1。

COMPATIBILITY NOTE 兼容性注意 

This deprecated tool exists for historical reasons but is still in use today. Its functionality will be merged to the main tool, at which time btrfstune will be declared obsolete and scheduled for removal.
由于历史原因,这个已弃用的工具仍在使用中。其功能将合并到主要工具中,届时 btrfstune 将被宣布过时并计划移除。

SEE ALSO 参见 

btrfs(5), btrfs-balance(8), mkfs.btrfs(8)