Reflink — BTRFS documentation
BTRFS
latest  最新

Overview 概述

  • Introduction 介绍
  • Status 状态
  • Manual pages 手册页面
  • Administration 管理
  • Hardware considerations 硬件考虑
  • Changes (feature/version)
    变更(功能/版本)
  • Changes (kernel/version)
    变更(内核/版本)
  • Changes (btrfs-progs) 变更(btrfs-progs)
  • Contributors 贡献者
  • Glossary 术语表
  • Installation instructions
    安装说明
  • Source repositories 源代码库

Features 特性

  • Common Linux features 常见的 Linux 特性
  • Custom ioctls 自定义 ioctls
  • Auto-repair on read 读取时自动修复
  • Balance 平衡
  • Compression 压缩
  • Checksumming 校验和
  • Convert 转换
  • Deduplication 重复数据删除
  • Defragmentation 碎片整理
  • Inline files 内联文件
  • Quota groups 配额组
  • Reflink 引用链接
  • Resize 调整大小
  • Scrub 擦拭
  • Seeding device 种子设备
  • Send/receive 发送/接收
  • Subpage support 子页面支持
  • Subvolumes 子卷
  • Swapfile 交换文件
  • Tree checker 树检查器
  • Trim/discard 修剪/丢弃
  • Volume management 卷管理
  • Zoned mode 分区模式

Developer documentation 开发者文档

  • Development notes 开发说明
  • Developer’s FAQ 开发者常见问题解答
  • Conventions and style for documentation
    文档约定和风格
  • Experimental features 实验性功能
  • Btrfs design Btrfs 设计
  • Btrees
  • On-disk Format 磁盘格式
  • Send stream format 发送流格式
  • JSON output JSON 输出
  • Internal APIs 内部 API
  • Release checklist 发布清单
  • btrfs-ioctl(2)

TODO 待办事项

  • Quick start 快速开始
  • Interoperability 互操作性
  • Troubleshooting pages 故障排除页面
BTRFS
  • Reflink 引用链接
  • Edit on GitHub
    在 GitHub 上编辑

Reflink 引用链接 

Reflink is a type of shallow copy of file data that shares the blocks but otherwise the files are independent and any change to the file will not affect the other. This builds on the underlying COW mechanism. A reflink will effectively create only a separate metadata pointing to the shared blocks which is typically much faster than a deep copy of all blocks.
引用链接是文件数据的一种浅拷贝类型,共享块,但文件本身是独立的,对文件的任何更改都不会影响其他文件。这是基于底层的 COW 机制。引用链接实际上只会创建一个指向共享块的单独元数据,通常比深度复制所有块要快得多。

The reflink is typically meant for whole files but a partial file range can be also copied, though there are no ready-made tools for that.
reflink 通常用于整个文件,但也可以复制部分文件范围,尽管目前没有现成的工具。

cp --reflink=always source target

There are some constraints:
有一些限制:

  • cross-filesystem reflink is not possible, there’s nothing in common between so the block sharing can’t work
    跨文件系统的 reflink 是不可能的,因为它们之间没有共同之处,所以块共享无法工作。

  • reflink crossing two mount points of the same filesystem support depends on kernel version:
    跨越同一文件系统的两个挂载点的 reflink 支持取决于内核版本:

    • until 5.17 it’s not supported and fails with “Cross device link”, can be worked around by performing the operation on the toplevel subvolume
      在 5.17 版本之前不支持,并且会出现“跨设备链接”错误,可以通过在顶级子卷上执行操作来解决

    • works since 5.18 从 5.18 版本开始支持

  • reflink requires source and target file that have the same status regarding NOCOW and checksums, for example if the source file is NOCOW (once created with the chattr +C attribute) then the above command won’t work unless the target file is pre-created with the +C attribute as well, or the NOCOW attribute is inherited from the parent directory (chattr +C on the directory) or if the whole filesystem is mounted with -o nodatacow that would create the NOCOW files by default
    reflink 需要源文件和目标文件在 NOCOW 和校验和方面具有相同的状态,例如,如果源文件是 NOCOW(使用 chattr +C 属性创建的),那么上述命令将不起作用,除非目标文件也预先使用 +C 属性创建,或者从父目录继承 NOCOW 属性(在目录上使用 chattr +C),或者整个文件系统被挂载为 -o nodatacow,这将默认创建 NOCOW 文件

Previous Next

© Copyright . Revision cae94956.
© 版权所有。修订版 cae94956 。

Built with Sphinx using a theme provided by Read the Docs.
使用由 Read the Docs 提供的主题构建的 Sphinx。
Read the Docs v: latest
Read the Docs 版本:最新
Versions 版本
latest 最新
stable 稳定
Downloads 下载
On Read the Docs
在 Read the Docs 上
Project Home 项目主页
Builds 构建