跳转至

The Second Extended Filesystem

原文档地址 ext2 was originally released in January 1993. Written by R'emy Card, Theodore Ts’o and Stephen Tweedie, it was a major rewrite of the Extended Filesystem. It is currently still (April 2001) the predominant filesystem in use by Linux. There are also implementations available for NetBSD, FreeBSD, the GNU HURD, Windows 95/98/NT, OS/2 and RISC OS.

ext2最初于1993年1月发布。这是由R'emy Card、Theodore Tso和Stephen Tweedie编写的,是对扩展文件系统的一次重大改写。目前(2001年4月)它仍然是Linux使用的主要文件系统。也有适用于NetBSD、FreeBSD、GNU HURD、Windows 95/98/NT、OS/2和RISC OS的实现。

1 Options

Most defaults are determined by the filesystem superblock, and can be set using tune2fs(8). Kernel-determined defaults are indicated by (*).

大多数默认值由文件系统超级块决定,可以使用tune2fs(8)进行设置。内核确定的默认值由(*)表示。

bsddf (*) Makes df act like BSD.
minixdf Makes df act like Minix.
check=none, nocheck (*) Don’t do extra checking of bitmaps on mount (check=normal and check=strict options removed)
dax Use direct access (no page cache). See Direct Access for files.
debug Extra debugging information is sent to the kernel syslog. Useful for developers.
errors=continue Keep going on a filesystem error.
errors=remount-ro Remount the filesystem read-only on an error.
errors=panic Panic and halt the machine if an error occurs.
grpid, bsdgroups Give objects the same group ID as their parent.
nogrpid, sysvgroups New objects have the group ID of their creator.
nouid32 Use 16-bit UIDs and GIDs.
oldalloc Enable the old block allocator. Orlov should have better performance, we’d like to get some feedback if it’s the contrary for you.
orlov (*) Use the Orlov block allocator. (See http://lwn.net/Articles/14633/ and http://lwn.net/Articles/14446/.)
resuid=n The user ID which may use the reserved blocks.
resgid=n The group ID which may use the reserved blocks.
sb=n Use alternate superblock at this location.
user_xattr Enable “user.” POSIX Extended Attributes (requires CONFIG_EXT2_FS_XATTR).
nouser_xattr Don’t support “user.” extended attributes.
acl Enable POSIX Access Control Lists support (requires CONFIG_EXT2_FS_POSIX_ACL).
noacl Don’t support POSIX ACLs.
quota, usrquota Enable user disk quota support (requires CONFIG_QUOTA).
grpquota Enable group disk quota support (requires CONFIG_QUOTA).

noquota option ls silently ignored by ext2.

noquota选项被ext2默默忽略。

2 Specification

ext2 shares many properties with traditional Unix filesystems. It has the concepts of blocks, inodes and directories. It has space in the specification for Access Control Lists (ACLs), fragments, undeletion and compression though these are not yet implemented (some are available as separate patches). There is also a versioning mechanism to allow new features (such as journalling) to be added in a maximally compatible manner.

ext2与传统的Unix文件系统共享许多属性。它有块、索引节点和目录的概念。它在访问控制列表(ACL)、片段、取消删除和压缩的规范中有空间,尽管这些还没有实现(有些作为单独的补丁提供)。还有一种版本控制机制,允许以最大兼容的方式添加新功能(如日志记录)。

2.1 Blocks

The space in the device or file is split up into blocks. These are a fixed size, of 1024, 2048 or 4096 bytes (8192 bytes on Alpha systems), which is decided when the filesystem is created. Smaller blocks mean less wasted space per file, but require slightly more accounting overhead, and also impose other limits on the size of files and the filesystem.

设备或文件中的空间被分割成块。这是一个固定的大小,1024、2048或4096字节(Alpha系统上为8192字节),由创建文件系统时决定。更小的块意味着每个文件浪费的空间更少,但需要稍微更多的记帐开销,并且还对文件和文件系统的大小施加了其他限制。

2.2 Block Groups

Blocks are clustered into block groups in order to reduce fragmentation and minimise the amount of head seeking when reading a large amount of consecutive data. Information about each block group is kept in a descriptor table stored in the block(s) immediately after the superblock. Two blocks near the start of each group are reserved for the block usage bitmap and the inode usage bitmap which show which blocks and inodes are in use. Since each bitmap is limited to a single block, this means that the maximum size of a block group is 8 times the size of a block.

当读取大量连续数据时,为了减少碎片并最小化头部搜索量,将块聚类为块组。关于每个块组的信息保存在超级块之后立即存储在块中的描述符表中。每个组开头附近的两个块被保留用于块使用位图和inode使用位图,它们显示哪些块和inode正在使用。由于每个位图仅限于单个块,这意味着块组的最大大小是块大小的8倍。

The block(s) following the bitmaps in each block group are designated as the inode table for that block group and the remainder are the data blocks. The block allocation algorithm attempts to allocate data blocks in the same block group as the inode which contains them.

每个块组中位图后面的块被指定为该块组的索引节点表,其余的是数据块。块分配算法尝试在与包含数据块的索引节点相同的块组中分配数据块。

2.3 The Superblock

The superblock contains all the information about the configuration of the filing system. The primary copy of the superblock is stored at an offset of 1024 bytes from the start of the device, and it is essential to mounting the filesystem. Since it is so important, backup copies of the superblock are stored in block groups throughout the filesystem. The first version of ext2 (revision 0) stores a copy at the start of every block group, along with backups of the group descriptor block(s). Because this can consume a considerable amount of space for large filesystems, later revisions can optionally reduce the number of backup copies by only putting backups in specific groups (this is the sparse superblock feature). The groups chosen are 0, 1 and powers of 3, 5 and 7.

超级块包含有关文件系统配置的所有信息。超级块的主副本存储在距离设备开始位置1024字节的偏移位置,这对于安装文件系统至关重要。由于这一点非常重要,超级块的备份副本存储在整个文件系统的块组中。ext2的第一个版本(修订版0)在每个块组的开头存储一个副本,以及组描述符块的备份。因为这会为大型文件系统消耗大量空间,所以以后的版本可以通过只将备份放在特定的组中(这是稀疏超级块特性)来选择性地减少备份副本的数量。所选的组是0、1和3、5和7的幂。

The information in the superblock contains fields such as the total number of inodes and blocks in the filesystem and how many are free, how many inodes and blocks are in each block group, when the filesystem was mounted (and if it was cleanly unmounted), when it was modified, what version of the filesystem it is (see the Revisions section below) and which OS created it.

超级块中的信息包含一些字段,例如文件系统中的索引节点和块的总数、空闲的数量、每个块组中有多少索引节点和数据块、文件系统何时装载(如果已完全卸载)、何时修改、文件系统的版本(请参阅下面的修订部分)以及创建它的操作系统。

If the filesystem is revision 1 or higher, then there are extra fields, such as a volume name, a unique identification number, the inode size, and space for optional filesystem features to store configuration info.

如果文件系统是修订版1或更高版本,则会有额外的字段,例如卷名、唯一标识号、inode大小以及可选文件系统功能存储配置信息的空间。

All fields in the superblock (as in all other ext2 structures) are stored on the disc in little endian format, so a filesystem is portable between machines without having to know what machine it was created on.

超级块中的所有字段(与所有其他ext2结构中的字段一样)都以小端格式存储在磁盘上,因此文件系统可以在机器之间移植,而不必知道它是在什么机器上创建的。

2.4 Inodes

The inode (index node) is a fundamental concept in the ext2 filesystem. Each object in the filesystem is represented by an inode. The inode structure contains pointers to the filesystem blocks which contain the data held in the object and all of the metadata about an object except its name. The metadata about an object includes the permissions, owner, group, flags, size, number of blocks used, access time, change time, modification time, deletion time, number of links, fragments, version (for NFS) and extended attributes (EAs) and/or Access Control Lists (ACLs).

inode(索引节点)是ext2文件系统中的一个基本概念。文件系统中的每个对象都由一个inode表示。inode结构包含指向文件系统块的指针,这些文件系统块包含对象中保存的数据以及除名称之外的所有关于对象的元数据。关于对象的元数据包括权限、所有者、组、标志、大小、使用的块数、访问时间、更改时间、修改时间、删除时间、链接数、片段、版本(对于NFS)和扩展属性(EA)和/或访问控制列表(ACL)。

There are some reserved fields which are currently unused in the inode structure and several which are overloaded. One field is reserved for the directory ACL if the inode is a directory and alternately for the top 32 bits of the file size if the inode is a regular file (allowing file sizes larger than 2GB). The translator field is unused under Linux, but is used by the HURD to reference the inode of a program which will be used to interpret this object. Most of the remaining reserved fields have been used up for both Linux and the HURD for larger owner and group fields, The HURD also has a larger mode field so it uses another of the remaining fields to store the extra more bits.

有一些保留字段当前在inode结构中未使用,还有几个字段被重载。如果索引节点是目录,则为目录ACL保留一个字段,如果索引节点为常规文件(允许文件大小大于2GB),则为文件大小的前32位保留一个。转换器字段在Linux下未使用,但HURD使用它来引用将用于解释此对象的程序的inode。大多数剩余的保留字段已用于Linux和HURD,用于更大的所有者和组字段。HURD还有一个更大的模式字段,因此它使用剩余的另一个字段来存储更多的位。

There are pointers to the first 12 blocks which contain the file’s data in the inode. There is a pointer to an indirect block (which contains pointers to the next set of blocks), a pointer to a doubly-indirect block (which contains pointers to indirect blocks) and a pointer to a trebly-indirect block (which contains pointers to doubly-indirect blocks).

有指向索引节点中包含文件数据的前12个块的指针。有一个指向间接块的指针(它包含指向下一组块的指针),一个指向双重间接块的指示器(它包含对间接块的指示)和一个指向三重间接块(它包含了对双重间接块)的指针。

The flags field contains some ext2-specific flags which aren’t catered for by the standard chmod flags. These flags can be listed with lsattr and changed with the chattr command, and allow specific filesystem behaviour on a per-file basis. There are flags for secure deletion, undeletable, compression, synchronous updates, immutability, append-only, dumpable, no-atime, indexed directories, and data-journaling. Not all of these are supported yet.

flags字段包含一些标准chmod标志无法满足的ext2特定标志。这些标志可以用lsattr列出,也可以用chattr命令更改,并允许每个文件的特定文件系统行为。有安全删除、不可删除、压缩、同步更新、不变性、仅追加、可转储、无延迟、索引目录和数据日志的标志。并非所有这些都得到支持。

2.5 Directories

A directory is a filesystem object and has an inode just like a file. It is a specially formatted file containing records which associate each name with an inode number. Later revisions of the filesystem also encode the type of the object (file, directory, symlink, device, fifo, socket) to avoid the need to check the inode itself for this information (support for taking advantage of this feature does not yet exist in Glibc 2.2).

目录是一个文件系统对象,它有一个像文件一样的inode。它是一个特殊格式的文件,包含将每个名称与inode编号关联的记录。文件系统的后续版本还对对象的类型(文件、目录、符号链接、设备、fifo、套接字)进行编码,以避免需要检查inode本身以获取此信息(Glibc 2.2中尚不支持利用此功能)。

The inode allocation code tries to assign inodes which are in the same block group as the directory in which they are first created.

inode分配代码尝试分配与最初创建它们的目录在同一块组中的inode。

The current implementation of ext2 uses a singly-linked list to store the filenames in the directory; a pending enhancement uses hashing of the filenames to allow lookup without the need to scan the entire directory.

ext2的当前实现使用单链接列表来存储目录中的文件名;一个待定的增强使用文件名的哈希来允许查找,而无需扫描整个目录。

The current implementation never removes empty directory blocks once they have been allocated to hold more files.

当前的实现在分配了空目录块以容纳更多文件后,不会删除它们。

2.6 Special files

Symbolic links are also filesystem objects with inodes. They deserve special mention because the data for them is stored within the inode itself if the symlink is less than 60 bytes long. It uses the fields which would normally be used to store the pointers to data blocks. This is a worthwhile optimisation as it we avoid allocating a full block for the symlink, and most symlinks are less than 60 characters long.

符号链接也是具有索引节点的文件系统对象。它们值得特别注意,因为如果符号链接长度小于60字节,则它们的数据存储在inode本身中。它使用通常用于存储数据块指针的字段。这是一个值得的优化,因为我们避免为符号链接分配一个完整的块,并且大多数符号链接的长度都小于60个字符。

Character and block special devices never have data blocks assigned to them. Instead, their device number is stored in the inode, again reusing the fields which would be used to point to the data blocks.

字符和块专用设备从不分配数据块。相反,它们的设备号存储在inode中,再次重用将用于指向数据块的字段。

2.7 Reserved Space

In ext2, there is a mechanism for reserving a certain number of blocks for a particular user (normally the super-user). This is intended to allow for the system to continue functioning even if non-privileged users fill up all the space available to them (this is independent of filesystem quotas). It also keeps the filesystem from filling up entirely which helps combat fragmentation.

在ext2中,有一种机制为特定用户(通常是超级用户)保留一定数量的块。这是为了允许系统继续运行,即使非特权用户占用了所有可用空间(这与文件系统配额无关)。它还防止文件系统完全填满,这有助于防止碎片化。

2.8 Filesystem check

At boot time, most systems run a consistency check (e2fsck) on their filesystems. The superblock of the ext2 filesystem contains several fields which indicate whether fsck should actually run (since checking the filesystem at boot can take a long time if it is large). fsck will run if the filesystem was not cleanly unmounted, if the maximum mount count has been exceeded or if the maximum time between checks has been exceeded.

在启动时,大多数系统在其文件系统上运行一致性检查(e2fsck)。ext2文件系统的超级块包含几个字段,这些字段指示fsck是否应该实际运行(因为如果文件系统很大,在启动时检查文件系统可能需要很长时间)。如果文件系统未完全卸载,如果已超过最大装载计数,或者已超过检查间隔的最长时间,则fsck将运行。

2.9 Feature Compatibility功能兼容性

The compatibility feature mechanism used in ext2 is sophisticated. It safely allows features to be added to the filesystem, without unnecessarily sacrificing compatibility with older versions of the filesystem code. The feature compatibility mechanism is not supported by the original revision 0 (EXT2_GOOD_OLD_REV) of ext2, but was introduced in revision 1. There are three 32-bit fields, one for compatible features (COMPAT), one for read-only compatible (RO_COMPAT) features and one for incompatible (INCOMPAT) features.

ext2中使用的兼容性特性机制非常复杂。它安全地允许将特性添加到文件系统中,而不会不必要地牺牲与旧版本文件系统代码的兼容性。EXT2的原始版本0(EXT2_GOOD_OLD_REV)不支持功能兼容性机制,但在版本1中引入了该机制。有三个32位字段,一个用于兼容功能(COMPAT)、一个用于只读兼容功能(RO_COMPAT)和一个用于不兼容功能(INCOMPAT)。

These feature flags have specific meanings for the kernel as follows:

这些功能标志对内核具有如下特定含义:

A COMPAT flag indicates that a feature is present in the filesystem, but the on-disk format is 100% compatible with older on-disk formats, so a kernel which didn’t know anything about this feature could read/write the filesystem without any chance of corrupting the filesystem (or even making it inconsistent). This is essentially just a flag which says “this filesystem has a (hidden) feature” that the kernel or e2fsck may want to be aware of (more on e2fsck and feature flags later). The ext3 HAS_JOURNAL feature is a COMPAT flag because the ext3 journal is simply a regular file with data blocks in it so the kernel does not need to take any special notice of it if it doesn’t understand ext3 journaling.

COMPAT标志表示文件系统中存在一个功能,但磁盘格式与旧的磁盘格式100%兼容,因此不了解该功能的内核可以读取/写入文件系统,而不会损坏文件系统(甚至使其不一致)。这本质上只是一个标志,它表示“这个文件系统有一个(隐藏的)特性”,内核或e2fsck可能想知道这个特性(稍后将详细介绍e2fsck和特性标志)。ext3 HAS_JOURNAL特性是一个COMPAT标志,因为ext3日志只是一个包含数据块的常规文件,所以如果内核不理解ext3日志,就不需要特别注意它。

An RO_COMPAT flag indicates that the on-disk format is 100% compatible with older on-disk formats for reading (i.e. the feature does not change the visible on-disk format). However, an old kernel writing to such a filesystem would/could corrupt the filesystem, so this is prevented. The most common such feature, SPARSE_SUPER, is an RO_COMPAT feature because sparse groups allow file data blocks where superblock/group descriptor backups used to live, and ext2_free_blocks() refuses to free these blocks, which would leading to inconsistent bitmaps. An old kernel would also get an error if it tried to free a series of blocks which crossed a group boundary, but this is a legitimate layout in a SPARSE_SUPER filesystem.

RO_COMPAT标志表示磁盘上的格式与旧的磁盘上的读取格式100%兼容(即,该功能不会更改可见的磁盘上格式)。然而,旧内核写入这样的文件系统会损坏文件系统,因此这是可以防止的。最常见的这种特性SPARSE_SUPER是RO_COMPAT特性,因为稀疏组允许超级块/组描述符备份所在的文件数据块,而ext2_free_block()拒绝释放这些块,这将导致位图不一致。如果旧内核试图释放一系列跨越组边界的块,也会出现错误,但这是SPARSE_SUPER文件系统中的合法布局。

An INCOMPAT flag indicates the on-disk format has changed in some way that makes it unreadable by older kernels, or would otherwise cause a problem if an old kernel tried to mount it. FILETYPE is an INCOMPAT flag because older kernels would think a filename was longer than 256 characters, which would lead to corrupt directory listings. The COMPRESSION flag is an obvious INCOMPAT flag - if the kernel doesn’t understand compression, you would just get garbage back from read() instead of it automatically decompressing your data. The ext3 RECOVER flag is needed to prevent a kernel which does not understand the ext3 journal from mounting the filesystem without replaying the journal.

INCOMPAT标志表示磁盘上的格式发生了某种变化,使得旧内核无法读取该格式,或者如果旧内核试图装载该格式,则会导致问题。FILETYPE是一个INCOMPATT标志,因为旧内核会认为文件名超过256个字符,这会导致目录列表损坏。COMPRESSION标志是一个明显的INCOMPAT标志——如果内核不理解压缩,您只需要从read()中获取垃圾,而不是自动解压缩数据。需要ext3 RECOVER标志来防止不理解ext3日志的内核在不重放日志的情况下装载文件系统。

For e2fsck, it needs to be more strict with the handling of these flags than the kernel. If it doesn’t understand ANY of the COMPAT, RO_COMPAT, or INCOMPAT flags it will refuse to check the filesystem, because it has no way of verifying whether a given feature is valid or not. Allowing e2fsck to succeed on a filesystem with an unknown feature is a false sense of security for the user. Refusing to check a filesystem with unknown features is a good incentive for the user to update to the latest e2fsck. This also means that anyone adding feature flags to ext2 also needs to update e2fsck to verify these features.

对于e2fsck,它需要比内核更严格地处理这些标志。如果它不理解COMPAT、RO_COMPAT或INCOMPAT标志,它将拒绝检查文件系统,因为它无法验证给定功能是否有效。对于用户来说,允许e2fsck在具有未知特性的文件系统上成功是一种错误的安全感。拒绝检查具有未知特性的文件系统是用户更新到最新e2fsck的良好激励。这也意味着任何向ext2添加特性标志的人都需要更新e2fsck来验证这些特性。

2.10 Metadata

It is frequently claimed that the ext2 implementation of writing asynchronous metadata is faster than the ffs synchronous metadata scheme but less reliable. Both methods are equally resolvable by their respective fsck programs.

人们经常声称,编写异步元数据的ext2实现比ffs同步元数据方案更快,但不太可靠。这两种方法都可以通过各自的fsck程序进行同样的解析。

If you’re exceptionally paranoid, there are 3 ways of making metadata writes synchronous on ext2:

  • per-file if you have the program source: use the O_SYNC flag to open()
  • per-file if you don’t have the source: use “chattr +S” on the file
  • per-filesystem: add the “sync” option to mount (or in /etc/fstab)

如果您异常偏执,有3种方法可以使ext2上的元数据写入同步:

  • 每个文件(如果有程序源):使用O_SYNC标志open()
  • 如果没有源代码,请按文件:在文件上使用“chattr+S”
  • 每个文件系统:添加“sync”选项以装载(或在/etc/fstab中)

the first and last are not ext2 specific but do force the metadata to be written synchronously. See also Journaling below.

第一个和最后一个不是ext2特定的,但确实强制同步写入元数据。另请参阅下面的日志记录。

2.11 Limitations

There are various limits imposed by the on-disk layout of ext2. Other limits are imposed by the current implementation of the kernel code. Many of the limits are determined at the time the filesystem is first created, and depend upon the block size chosen. The ratio of inodes to data blocks is fixed at filesystem creation time, so the only way to increase the number of inodes is to increase the size of the filesystem. No tools currently exist which can change the ratio of inodes to blocks.

ext2的磁盘布局有各种限制。其他限制是由内核代码的当前实现强加的。许多限制是在首次创建文件系统时确定的,并取决于所选的块大小。索引节点与数据块的比率在文件系统创建时是固定的,因此增加索引节点数量的唯一方法是增加文件系统的大小。目前没有工具可以改变索引节点与块的比率。

Most of these limits could be overcome with slight changes in the on-disk format and using a compatibility flag to signal the format change (at the expense of some compatibility).

这些限制中的大多数都可以通过对磁盘格式进行轻微更改并使用兼容性标志来表示格式更改(以牺牲某些兼容性为代价)来克服。

Filesystem block size 1kB 2kB 4kB 8kB
File size limit 16GB 256GB 2048GB 2048GB
Filesystem size limit 2047GB 8192GB 16384GB 32768GB

There is a 2.4 kernel limit of 2048GB for a single block device, so no filesystem larger than that can be created at this time. There is also an upper limit on the block size imposed by the page size of the kernel, so 8kB blocks are only allowed on Alpha systems (and other architectures which support larger pages).

单个块设备的2.4内核限制为2048GB,因此此时不能创建大于此值的文件系统。内核的页面大小对块大小也有上限,因此仅在Alpha系统(以及其他支持较大页面的架构)上允许8kB的块。

There is an upper limit of 32000 subdirectories in a single directory.

单个目录中有32000个子目录的上限。

There is a “soft” upper limit of about 10-15k files in a single directory with the current linear linked-list directory implementation. This limit stems from performance problems when creating and deleting (and also finding) files in such large directories. Using a hashed directory index (under development) allows 100k-1M+ files in a single directory without performance problems (although RAM size becomes an issue at this point).

在当前的线性链表目录实现中,单个目录中的“软”上限约为10-15k个文件。这种限制源于在如此大的目录中创建和删除(以及查找)文件时的性能问题。使用散列目录索引(正在开发中)允许在单个目录中存储100k-1M+文件,而不会出现性能问题(尽管此时RAM大小已成为一个问题)。

The (meaningless) absolute upper limit of files in a single directory (imposed by the file size, the realistic limit is obviously much less) is over 130 trillion files. It would be higher except there are not enough 4-character names to make up unique directory entries, so they have to be 8 character filenames, even then we are fairly close to running out of unique filenames.

单个目录中文件的(无意义的)绝对上限(由文件大小决定,实际限制显然要小得多)超过130万亿个文件。除非没有足够的4个字符的名称来组成唯一的目录条目,否则它会更高,所以它们必须是8个字符的文件名,即使这样,我们的唯一文件名也快要用完了。

2.12 Journaling

A journaling extension to the ext2 code has been developed by Stephen Tweedie. It avoids the risks of metadata corruption and the need to wait for e2fsck to complete after a crash, without requiring a change to the on-disk ext2 layout. In a nutshell, the journal is a regular file which stores whole metadata (and optionally data) blocks that have been modified, prior to writing them into the filesystem. This means it is possible to add a journal to an existing ext2 filesystem without the need for data conversion.

StephenTweedie开发了ext2代码的日志扩展。它避免了元数据损坏的风险,以及在崩溃后等待e2fsck完成的需要,而不需要更改磁盘上的ext2布局。简言之,日志是一个常规文件,它存储在写入文件系统之前已修改的所有元数据(以及可选的数据)块。这意味着可以将日志添加到现有的ext2文件系统中,而不需要数据转换。

When changes to the filesystem (e.g. a file is renamed) they are stored in a transaction in the journal and can either be complete or incomplete at the time of a crash. If a transaction is complete at the time of a crash (or in the normal case where the system does not crash), then any blocks in that transaction are guaranteed to represent a valid filesystem state, and are copied into the filesystem. If a transaction is incomplete at the time of the crash, then there is no guarantee of consistency for the blocks in that transaction so they are discarded (which means any filesystem changes they represent are also lost). Check Documentation/filesystems/ext4/ if you want to read more about ext4 and journaling.

当对文件系统的更改(例如,文件被重命名)时,这些更改存储在日志中的事务中,并且在崩溃时可以是完整的或不完整的。如果一个事务在崩溃时(或者在正常情况下,系统没有崩溃)完成,那么该事务中的任何块都保证表示有效的文件系统状态,并被复制到文件系统中。如果一个事务在崩溃时不完整,那么无法保证该事务中的块的一致性,因此它们将被丢弃(这意味着它们所代表的任何文件系统更改也将丢失)。如果您想了解有关ext4和日志的更多信息,请查看Documentation/filess/ext4/。

3 References

The kernel source file:/usr/src/linux/fs/ext2/
e2fsprogs (e2fsck) http://e2fsprogs.sourceforge.net/
Design & Implementation http://e2fsprogs.sourceforge.net/ext2intro.html
Journaling (ext3) ftp://ftp.uk.linux.org/pub/linux/sct/fs/jfs/
Filesystem Resizing http://ext2resize.sourceforge.net/
Compression 1 http://e2compr.sourceforge.net/

Implementations for:

Windows 95/98/NT/2000 http://www.chrysocome.net/explore2fs
Windows 95 1 http://www.yipton.net/content.html#FSDEXT2
DOS client 1 ftp://metalab.unc.edu/pub/Linux/system/filesystems/ext2/
OS/2 2 ftp://metalab.unc.edu/pub/Linux/system/filesystems/ext2/
RISC OS client http://www.esw-heim.tu-clausthal.de/~marco/smorbrod/IscaFS/

no longer actively developed/supported (as of Apr 2001)

no longer actively developed/supported (as of Mar 2009)