Glossary 术语表
Terms in italics also appear in this glossary.
斜体字中的术语也出现在本术语表中。
- allocator 分配器
Usually allocator means the block allocator, i.e. the logic inside filesystem which decides where to place newly allocated blocks in order to maintain several constraints (like data locality, low fragmentation).
通常分配器指的是块分配器,即文件系统内部的逻辑,用于决定在哪里放置新分配的块,以满足多个约束条件(如数据局部性,低碎片化)。In btrfs, allocator may also refer to chunk allocator, i.e. the logic behind placing chunks on devices.
在 btrfs 中,分配器也可能指的是块分配器,即在设备上放置块的逻辑。- balance 平衡
An operation that can be done to a btrfs filesystem, for example through btrfs fi balance /path. A balance passes all data in the filesystem through the allocator again. It is primarily intended to rebalance the data in the filesystem across the devices when a device is added or removed. A balance will regenerate missing copies for the redundant RAID levels, if a device has failed. As of Linux kernel 3.3, a balance operation can be made selective about which parts of the filesystem are rewritten.
可以对 btrfs 文件系统执行的操作,例如通过 btrfs fi balance /path。平衡会再次通过分配器传递文件系统中的所有数据。主要用于在添加或移除设备时重新平衡文件系统中的数据。如果设备故障,平衡将重新生成冗余 RAID 级别的丢失副本。从 Linux 内核 3.3 开始,平衡操作可以选择性地重写文件系统的哪些部分。- barrier 障碍
An instruction to the disk hardware to ensure that everything before the barrier is physically written to permanent storage before anything after it. Used in btrfs’s copy on write approach to ensure filesystem consistency.
一个指令,用于确保障碍之前的所有内容在障碍之后的任何内容之前被物理写入永久存储。在 btrfs 的写时复制方法中使用,以确保文件系统的一致性。- block 块
A single physically and logically contiguous piece of storage on a device, of size e.g. 4K.
设备上的一个单个物理上和逻辑上连续的存储块,大小为例如 4K。- block group 块组
The unit of allocation of space in btrfs. A block group is laid out on the disk by the btrfs allocator, and will consist of one or more chunks, each stored on a different device. The number of chunks used in a block group will depend on its RAID level.
btrfs 中空间分配的单位。块组由 btrfs 分配器在磁盘上布局,并将由一个或多个块组成,每个块存储在不同的设备上。块组中使用的块数取决于其 RAID 级别。- B-tree B 树
The fundamental storage data structure used in btrfs. Except for the superblocks, all of btrfs metadata is stored in one of several B-trees on disk. B-trees store key/item pairs. While the same code is used to implement all of the B-trees, there are a few different categories of B-tree. The name btrfs refers to its use of B-trees.
btrfs 中使用的基本存储数据结构。除了超级块外,所有 btrfs 元数据都存储在磁盘上的几个 B 树之一中。B 树存储键/项对。虽然相同的代码用于实现所有 B 树,但有几个不同类别的 B 树。btrfs 的名称指的是其使用 B 树。- btrfsck
Tool in btrfs-progs that checks a filesystem offline (i.e. unmounted), and reports on any errors in the filesystem structures it finds. By default the tool runs in read-only mode as fixing errors is potentially dangerous. See also scrub.
btrfs-progs 中的工具,用于离线检查文件系统(即卸载),并报告发现的文件系统结构中的任何错误。默认情况下,该工具以只读模式运行,因为修复错误可能是危险的。另请参见 scrub。- btrfs-progs
User mode tools to manage btrfs-specific features. Maintained at http://github.com/kdave/btrfs-progs.git . The main frontend to btrfs features is the standalone tool btrfs, although other tools such as mkfs.btrfs and btrfstune are also part of btrfs-progs.
用于管理 btrfs 特定功能的用户模式工具。维护在 http://github.com/kdave/btrfs-progs.git 。btrfs 功能的主要前端是独立工具 btrfs,尽管其他工具如 mkfs.btrfs 和 btrfstune 也是 btrfs-progs 的一部分。- chunk 块
A part of a block group. Chunks are either 1 GiB in size (for data) or 256 MiB (for metadata).
块组的一部分。块的大小可以是 1 GiB(用于数据)或 256 MiB(用于元数据)。- chunk tree 块树
A layer that keeps information about mapping between physical and logical block addresses. It’s stored within the system group.
保留有关物理和逻辑块地址之间映射的信息的层。它存储在系统组内部。- cleaner 清理程序
Usually referred to in context of deleted subvolumes. It’s a background process that removes the actual data once a subvolume has been deleted. Cleaning can involve lots of IO and CPU activity depending on the fragmentation and amount of shared data with other subvolumes.
通常在删除子卷的情况下提到。这是一个后台进程,一旦删除了子卷,它会删除实际数据。清理可能涉及大量的 IO 和 CPU 活动,具体取决于碎片化程度和与其他子卷共享数据的数量。- copy-on-write 写时复制
Also known as COW. The method that btrfs uses for modifying data. Instead of directly overwriting data in place, btrfs takes a copy of the data, alters it, and then writes the modified data back to a different (free) location on the disk. It then updates the metadata to reflect the new location of the data. In order to update the metadata, the affected metadata blocks are also treated in the same way. In COW filesystems, files tend to fragment as they are modified. Copy-on-write is also used in the implementation of snapshots and reflink copies. A copy-on-write filesystem is, in theory, always consistent, provided the underlying hardware supports barriers.
也被称为 COW。btrfs 用于修改数据的方法。btrfs 不直接在原地覆盖数据,而是复制数据,修改数据,然后将修改后的数据写回磁盘上的不同(空闲)位置。然后更新元数据以反映数据的新位置。为了更新元数据,受影响的元数据块也以相同的方式处理。在 COW 文件系统中,文件在修改时往往会碎片化。写时复制还用于快照和引用复制的实现。理论上,写时复制文件系统始终保持一致,前提是底层硬件支持屏障。- COW
See copy-on-write. 参见写时复制。
- default subvolume 默认子卷。
The subvolume in a btrfs filesystem which is mounted when mounting the filesystem without using the
subvol=
mount option.
在挂载文件系统时不使用subvol=
挂载选项时挂载的 btrfs 文件系统中的子卷。- device 设备
A Linux block device, e.g. a whole disk, partition, LVM logical volume, loopback device, or network block device. A btrfs filesystem can reside on one or more devices.
Linux 块设备,例如整个磁盘、分区、LVM 逻辑卷、回环设备或网络块设备。一个 btrfs 文件系统可以驻留在一个或多个设备上。- df
A standard Unix tool for reporting the amount of space used and free in a filesystem. The standard tool does not give accurate results, but the btrfs command from btrfs-progs has an implementation of df which shows space available in more detail. See the [[FAQ#Why_does_df_show_incorrect_free_space_for_my_RAID_volume.3F|FAQ]] for a more detailed explanation of btrfs free space accounting.
用于报告文件系统中已使用和空闲空间量的标准 Unix 工具。标准工具不提供准确的结果,但来自 btrfs-progs 的 btrfs 命令具有 df 的实现,可以更详细地显示可用空间。有关 btrfs 空闲空间记账的更详细解释,请参阅[[FAQ#Why_does_df_show_incorrect_free_space_for_my_RAID_volume.3F|FAQ]]。- DUP
A form of “RAID” which stores two copies of each piece of data on the same device. This is similar to RAID-1, and protects against block-level errors on the device, but does not provide any guarantees if the entire device fails. By default, btrfs uses DUP profile for metadata on filesystems with one rotational device, single profile on filesystems with one non-rotational device, and RAID1 profile on filesystems with more than one device.
一种“RAID”的形式,它在同一设备上存储每个数据块的两个副本。这类似于 RAID-1,并且可以防止设备上的块级错误,但如果整个设备发生故障,则不提供任何保证。默认情况下,btrfs 在具有一个旋转设备的文件系统上使用 DUP 配置文件用于元数据,在具有一个非旋转设备的文件系统上使用单个配置文件,在具有多个设备的文件系统上使用 RAID1 配置文件。- ENOSPC
Error code returned by the OS to a user program when the filesystem cannot allocate enough data to fulfill the user requested. In most filesystems, it indicates there is no free space available in the filesystem. Due to the additional space requirements from btrfs’s COW behaviour, btrfs can sometimes return ENOSPC when there is apparently (in terms of df) a large amount of space free. This is effectively a bug in btrfs, and (if it is repeatable), using the mount option
enospc_debug
may give a report that will help the btrfs developers. See the [[FAQ#if_your_device_is_large_.28.3E16GiB.29|FAQ entry]] on free space.
当文件系统无法分配足够的数据来满足用户请求时,操作系统向用户程序返回的错误代码。在大多数文件系统中,这表示文件系统中没有可用的空闲空间。由于 btrfs 的 COW 行为需要额外的空间,当文件系统中有大量空闲空间时(从 df 的角度看),btrfs 有时会返回 ENOSPC。这实际上是 btrfs 中的一个错误,(如果是可重复的),使用挂载选项enospc_debug
可能会提供一个报告,有助于 btrfs 开发人员。请参阅关于空闲空间的[[FAQ#if_your_device_is_large_.28.3E16GiB.29|FAQ entry]]。- extent 范围
Contiguous sequence of bytes on disk that holds file data.
磁盘上保存文件数据的连续字节序列。A file stored on disk with 3 extents means that it consists of three fragments of contiguous bytes. See filefrag. A file in one extent would mean it is not fragmented.
存储在磁盘上的文件具有 3 个范围,这意味着它由三个连续字节片段组成。请参阅 filefrag。一个范围内的文件意味着它没有碎片化。- Extent buffer 范围缓冲区
An abstraction to allow access to B-tree blocks larger than a page size.
一种抽象,允许访问大于页面大小的 B 树块。- fallocate 预分配
Command line tool in util-linux, and a syscall, that reserves space in the filesystem for a file, without actually writing any file data to the filesystem. First data write will turn the preallocated extents into regular ones. See fallocate(1) and fallocate(2) manual pages for more details.
在 util-linux 中的命令行工具和系统调用,用于为文件在文件系统中预留空间,而不实际将任何文件数据写入文件系统。第一次数据写入将把预分配的范围转换为常规范围。有关更多详细信息,请参阅 fallocate(1) 和 fallocate(2) 手册页面。- filefrag
A tool to show the number of extents in a file, and hence the amount of fragmentation in the file. It is usually part of the e2fsprogs package on most Linux distributions. While initially developed for the ext2 filesystem, it works on Btrfs as well. It uses the FIEMAP ioctl.
一个工具,用于显示文件中的范围数量,从而显示文件中的碎片数量。它通常是大多数 Linux 发行版中 e2fsprogs 软件包的一部分。虽然最初是为 ext2 文件系统开发的,但它也适用于 Btrfs。它使用 FIEMAP ioctl。- free space cache 空闲空间缓存
Btrfs doesn’t track free space, it only tracks allocated space. Free space is by definition any holes in the allocated space, but finding these holes is actually fairly I/O intensive. The free space cache stores a condensed representation of what is free. It is updated on every transaction commit.
Btrfs 不跟踪空闲空间,它只跟踪已分配的空间。空闲空间在定义上是已分配空间中的任何空洞,但查找这些空洞实际上是相当 I/O 密集的。空闲空间缓存存储了空闲空间的简化表示。它在每次事务提交时更新。- fsync
On Unix and Unix-like operating systems (of which Linux is the latter), the fsync(2) system call causes all buffered file descriptor related data changes to be flushed to the underlying block device. When a file is modified on a modern operating system the changes are generally not written to the disk immediately but rather those changes are buffered in memory for reasons of performance, calling fsync(2) causes any in-memory changes to be written to disk.
在类 Unix 操作系统(其中 Linux 是后者)上,fsync(2)系统调用会导致所有缓冲的文件描述符相关数据更改被刷新到底层块设备。当文件在现代操作系统上被修改时,通常不会立即将更改写入磁盘,而是将这些更改缓存在内存中以提高性能,调用 fsync(2)会导致任何内存中的更改被写入磁盘。- generation 生成
An internal counter which updates for each transaction. When a metadata block is written (using copy on write), current generation is stored in the block, so that blocks which are too new (and hence possibly inconsistent) can be identified.
一个内部计数器,用于每个事务更新。当写入元数据块(使用写时复制)时,当前生成会存储在块中,以便识别那些太新(因此可能不一致)的块。- key
A fixed sized tuple used to identify and sort items in a B-tree. The key is broken up into 3 parts: objectid, type, and offset. The type field indicates how each of the other two fields should be used, and what to expect to find in the item.
用于标识和排序 B 树中项目的固定大小元组。密钥分为 3 部分:对象 ID、类型和偏移量。类型字段指示如何使用其他两个字段,以及在项目中可以找到什么。- item 项目
A variable sized structure stored in B-tree leaves. Items hold different types of data depending on key type.
存储在 B 树叶中的可变大小结构。项目根据键类型保存不同类型的数据。- log tree 日志树
A b-tree that temporarily tracks ongoing metadata updates until a full transaction commit is done. It’s a performance optimization of
fsync
. The log tracked in the tree are replayed if the filesystem is not unmounted cleanly.
一种暂时跟踪进行中的元数据更新的 B 树,直到完成完整事务提交。这是对fsync
的性能优化。如果文件系统未被干净卸载,则树中跟踪的日志将被重放。- metadata 元数据
Data about data. In btrfs, this includes all of the internal data structures of the filesystem, including directory structures, filenames, file permissions, checksums, and the location of each file’s extents. All btrfs metadata is stored in B-trees.
有关数据的数据。在 btrfs 中,这包括文件系统的所有内部数据结构,包括目录结构、文件名、文件权限、校验和以及每个文件范围的位置。所有 btrfs 元数据都存储在 B 树中。- mkfs.btrfs
The tool (from btrfs-progs) to create a btrfs filesystem.
用于创建 btrfs 文件系统的工具(来自 btrfs-progs)。- offline 脱机
A filesystem which is not mounted is offline. Some tools (e.g. btrfsck) will only work on offline filesystems. Compare online.
未挂载的文件系统是脱机的。一些工具(例如 btrfsck)只能在脱机文件系统上运行。与在线比较。- online 在线
A filesystem which is mounted is online. Most btrfs tools will only work on online filesystems. Compare offline.
挂载的文件系统是在线的。大多数 btrfs 工具只能在在线文件系统上工作。与离线进行比较。- orphan 孤儿
A file that’s still in use (opened by a running process) but all directory entries of that file have been removed.
一个仍在使用中(被运行中的进程打开)但该文件的所有目录条目已被删除的文件。- RAID
A class of different methods for writing some additional redundant data across multiple devices so that if one device fails, the missing data can be reconstructed from the remaining ones. See RAID-0, RAID-1, RAID-5, RAID-6, RAID-10, DUP and single. Traditional RAID methods operate across multiple devices of equal size, whereas btrfs’s RAID implementation works inside block groups.
一类不同的方法,用于在多个设备上写入一些额外的冗余数据,以便如果一个设备失败,可以从剩余的设备中重建丢失的数据。参见 RAID-0、RAID-1、RAID-5、RAID-6、RAID-10、DUP 和 single。传统的 RAID 方法在多个大小相等的设备上运行,而 btrfs 的 RAID 实现在块组内部运行。- RAID-0
A form of RAID which provides no form of error recovery, but stripes a single copy of data across multiple devices for performance purposes. The stripe size is fixed to 64KB for now.
RAID-0 是一种 RAID 形式,它不提供任何形式的错误恢复,但会在多个设备之间分割单个数据副本以提高性能。目前条带大小固定为 64KB。- RAID-1
A form of RAID which stores two complete copies of each piece of data. Each copy is stored on a different device. btrfs requires a minimum of two devices to use RAID-1. This is the default for btrfs’s metadata on more than one device.
RAID 的一种形式,它存储每个数据块的两个完整副本。每个副本存储在不同的设备上。btrfs 需要至少两个设备才能使用 RAID-1。这是 btrfs 在多于一个设备上的元数据的默认设置。- RAID-5
A form of RAID which stripes a single copy of data across multiple devices, including one device’s worth of additional parity data. Can be used to recover from a single device failure.
RAID 的一种形式,它在多个设备上条带化单个数据副本,包括一个设备容量的额外奇偶校验数据。可用于从单个设备故障中恢复。- RAID-6
A form of RAID which stripes a single copy of data across multiple devices, including two device’s worth of additional parity data. Can be used to recover from the failure of two devices.
RAID-6 是一种 RAID 形式,它在多个设备上分布单个数据副本,包括两个设备价值的额外奇偶校验数据。可用于从两个设备故障中恢复。- RAID-10
A form of RAID which stores two complete copies of each piece of data, and also stripes each copy across multiple devices for performance.
一种 RAID 形式,它存储每个数据块的两个完整副本,并且还将每个副本跨多个设备进行分段以提高性能。- reflink
Parameter to cp, allowing it to take advantage of the capabilities of COW-capable filesystems. Allows for files to be copied and modified, with only the modifications taking up additional storage space. May be considered as snapshots on a single file rather than a subvolume. Example: cp --reflink file1 file2
cp 的参数,允许其利用 COW-capable 文件系统的功能。允许文件被复制和修改,只有修改会占用额外的存储空间。可以被视为单个文件上的快照,而不是子卷。示例:cp --reflink file1 file2- relocation 迁移
The process of moving block groups within the filesystem while maintaining full filesystem integrity and consistency. This functionality is underlying balance and device removing features.
在保持完整的文件系统完整性和一致性的同时,在文件系统内移动块组的过程。此功能是基础平衡和设备移除功能。- scrub 擦除
An online filesystem checking tool. Reads all the data and metadata on the filesystem, and uses checksums and the duplicate copies from RAID storage to identify and repair any corrupt data.
一个在线文件系统检查工具。读取文件系统上的所有数据和元数据,并使用校验和以及来自 RAID 存储的重复副本来识别和修复任何损坏的数据。- seed device 种子设备
A readonly device can be used as a filesystem seed or template (e.g. a CD-ROM containing an OS image). Read/write devices can be added to store modifications (using copy on write), changes to the writable devices are persistent across reboots. The original device remains unchanged and can be removed at any time (after Btrfs has been instructed to copy over all missing blocks). Multiple read/write file systems can be built from the same seed.
只读设备可以用作文件系统的种子或模板(例如,包含操作系统映像的 CD-ROM)。可以添加读/写设备以存储修改(使用写时复制),对可写设备的更改在重新启动后仍然保持。原始设备保持不变,并且可以随时移除(在 Btrfs 被指示复制所有丢失的块之后)。可以从同一种子构建多个读/写文件系统。- single 单个
A “RAID” level in btrfs, storing a single copy of each piece of data. The default for data (as opposed to metadata) in btrfs. Single is also default metadata profile for non-rotational (SSD, flash) devices.
btrfs 中的一种“RAID”级别,存储每个数据片段的单个副本。btrfs 中数据(与元数据相对)的默认设置。对于非旋转(SSD、闪存)设备,Single 也是默认的元数据配置文件。- snapshot 快照
A subvolume which is a copy on write copy of another subvolume. The two subvolumes share all of their common (unmodified) data, which means that snapshots can be used to keep the historical state of a filesystem very cheaply. After the snapshot is made, the original subvolume and the snapshot are of equal status: the original does not “own” the snapshot, and either one can be deleted without affecting the other one.
一个子卷,它是另一个子卷的写时复制副本。这两个子卷共享它们所有的公共(未修改的)数据,这意味着可以使用快照来廉价地保留文件系统的历史状态。制作快照后,原始子卷和快照处于相同的状态:原始子卷不“拥有”快照,可以删除其中任何一个而不影响另一个。- subvolume 子卷
A tree of files and directories inside a btrfs that can be mounted as if it were an independent filesystem. A subvolume is created by taking a reference on the root of another subvolume. Each btrfs filesystem has at least one subvolume, the top-level subvolume, which contains everything else in the filesystem. Additional subvolumes can be created and deleted with the btrfs< tool. All subvolumes share the same pool of free space in the filesystem. See also default subvolume.
btrfs 中的文件和目录树,可以像独立文件系统一样挂载。通过对另一个子卷的根目录引用来创建子卷。每个 btrfs 文件系统至少有一个子卷,即顶层子卷,其中包含文件系统中的所有其他内容。可以使用 btrfs 工具创建和删除其他子卷。所有子卷在文件系统中共享相同的空闲空间池。另请参阅默认子卷。- superblock 超级块
The block on the disk, at a fixed known location and of fixed size, which contains pointers to the disk blocks containing all the other filesystem metadata structures. btrfs stores multiple copies of the superblock on each device in the filesystem at offsets 64 KiB, 64 MiB, 256 GiB, 1 TiB and PiB.
磁盘上的块,位于固定已知位置,具有固定大小,其中包含指向包含所有其他文件系统元数据结构的磁盘块的指针。 btrfs 在文件系统中的每个设备上的偏移量为 64 KiB、64 MiB、256 GiB、1 TiB 和 PiB 处存储超级块的多个副本。- system array 系统数组
Cryptic name of superblock metadata describing how to assemble a filesystem from multiple device. Prior to mount, the command btrfs dev scan has to be called, or all the devices have to be specified via mount option device=/dev/ice.
描述如何从多个设备组装文件系统的超级块元数据的神秘名称。在挂载之前,必须调用命令 btrfs dev scan,或者通过挂载选项 device=/dev/ice 指定所有设备。- top-level subvolume 顶层子卷
The subvolume at the very top of the filesystem. This is the only subvolume present in a newly-created btrfs filesystem, and internally has ID 5, otherwise could be referenced as 0 (e.g. within the set-default subcommand of btrfs).
文件系统顶部的子卷。这是新创建的 btrfs 文件系统中唯一存在的子卷,内部 ID 为 5,否则可以被引用为 0(例如在 btrfs 的 set-default 子命令中)。- transaction 交易
A consistent set of changes. To avoid generating very large amounts of disk activity, btrfs caches changes in RAM for up to 30 seconds (sometimes more often if the filesystem is running short on space or doing a lot of fsync*s), and then writes (commits) these changes out to disk in one go (using *copy on write behaviour). This period of caching is called a transaction. Only one transaction is active on the filesystem at any one time.
一致的一组更改。为避免生成大量磁盘活动,btrfs 在 RAM 中缓存更改长达 30 秒(如果文件系统空间不足或执行大量 fsync* 操作,则有时更频繁),然后一次性将这些更改写入磁盘(使用写时复制行为)。这种缓存期称为一个交易。文件系统上一次只有一个交易处于活动状态。- transid 事务编号
An alternative term for generation.
一代的另一种说法。- writeback 回写
Writeback in the context of the Linux kernel can be defined as the process of writing “dirty” memory from the page cache to the disk, when certain conditions are met (timeout, number of dirty pages over a ratio).
在 Linux 内核的上下文中,回写可以被定义为在满足特定条件时(超时、脏页数量超过比例),将“脏”内存从页面缓存写入磁盘的过程。