# Ext3

**Ext3**，即第三代扩展文件系统，是在 ext2 文件系统上增加日志功能而成的 Linux 日志文件系统。它最初于 1999 年 9 月发布，由 Stephen Tweedie 为 Linux 2.2 内核分支编写，后来由 Peter Braam、Andreas Dilger、Andrew Morton、Alexander Viro、Ted Ts'o 和 Tweedie 移植到 2.4 内核。<sup>[1](https://docs.kernel.org/filesystems/ext3.html)</sup> 它于 2001 年被加入 [Linux 内核](https://www.edgepedia.org/zh/linux-kernel)，此后多年一直是大多数 Linux 发行版的默认文件系统。<sup>[2](https://distro.ibiblio.org/blacklab/Documentation/linux-commandline-and-scripting.pdf)</sup>

| 关键事实 | 详情 |
|---|---|
| 起源 | 1999 年 9 月由 Stephen Tweedie 为 Linux 2.2 发布；ext2 加日志<sup>[1](https://docs.kernel.org/filesystems/ext3.html)</sup> |
| 内核状态 | 独立的 ext3 驱动于 2015 年 6 月被移除（提交 c290ea01abb7）；ext3 文件系统由 ext4 驱动挂载<sup>[3](https://lists.openwall.net/linux-ext4/2025/09/26/15)</sup><sup> • </sup><sup>[1](https://docs.kernel.org/filesystems/ext3.html)</sup> |
| 日志模式 | `journal`（数据与元数据）、`ordered`（元数据，数据在元数据提交前先写出；默认模式）和 `writeback`（仅元数据，对数据写入顺序的约束较弱）<sup>[4](https://deadsec.team/linux/ext3fs/)</sup><sup> • </sup><sup>[5](https://manpages.debian.org/stretch/e2fsprogs/ext3.5.en.html)</sup> |
| 崩溃恢复 | 恢复时间取决于日志的大小，而非文件系统的大小或文件数量；默认日志的恢复约需一秒<sup>[6](https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/7/html/storage_administration_guide/ch-ext3)</sup> |
| 提交间隔 | 数据与元数据每 `commit=nrsec` 秒同步一次，默认 5 秒<sup>[5](https://manpages.debian.org/stretch/e2fsprogs/ext3.5.en.html)</sup> |
| 兼容性 | 正常卸载的 ext3 文件系统可以按 ext2 重新挂载；ext2 文件系统可以添加日志后按 ext3 重新挂载，无需重新格式化<sup>[7](https://www.oreilly.com/library/view/understanding-the-linux/0596002130/ch17s07.html)</sup> |

## 目的与设计

Ext3 的设计围绕两个目标：成为一个日志文件系统，并尽可能与 ext2 保持兼容。它在磁盘上的数据结构与 ext2 基本相同，因此旧文件系统的大部分行为都原样延续下来。<sup>[7](https://www.oreilly.com/library/view/understanding-the-linux/0596002130/ch17s07.html)</sup> 其实现方式也反映了这一渊源：Tweedie 描述说，他从整个 ext2 源码目录的副本开始，全局搜索并将“ext2”替换为“ext3”，只保留一棵独立的源码树，以便将新开发代码与稳定代码隔离开来。<sup>[8](https://compas.cs.stonybrook.edu/~nhonarmand/courses/sp17/cse506/papers/OLS2000-ext3.html)</sup>

日志要解决的问题是崩溃一致性。在 ext2 等传统 Unix 文件系统中，对文件系统块的更新可能在内存中停留很长时间才写入磁盘，因此断电或系统崩溃可能使文件系统处于不一致状态。此时每个 ext2 文件系统在挂载前都必须由 `e2fsck` 程序检查，这个过程耗时较长，会延迟启动，尤其是在大容量卷上，检查期间数据不可访问。<sup>[6](https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/7/html/storage_administration_guide/ch-ext3)</sup> 使用 ext3 后，非正常关机后不再需要这种全面检查；只有在罕见的硬件故障情况下才需要进行一致性检查。恢复过程就是重放日志，因此所需时间取决于日志的大小，而不是卷中存储了多少数据。<sup>[6](https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/7/html/storage_administration_guide/ch-ext3)</sup>

日志重放是一种快速恢复，并不保证应用程序最近写入的每一个字节都得以幸存。应用程序可能尚未同步其数据，而日志中可能只包含元数据；硬件故障或严重损坏仍可能需要离线文件系统检查。<sup>[4](https://deadsec.team/linux/ext3fs/)</sup>

## 日志模式

`data=` 挂载选项决定日志记录什么内容。元数据是指描述文件和目录的信息，如所有权、权限、时间戳、大小和块映射。<sup>[4](https://deadsec.team/linux/ext3fs/)</sup>

- **`journal`**：文件数据和元数据都写入日志。这在三种模式中提供最强的保护，防止文件内容不一致，但开销也最高。<sup>[4](https://deadsec.team/linux/ext3fs/)</sup>
- **`ordered`**：元数据记入日志，相关数据在其元数据提交到日志之前被强制直接写出到主文件系统。这是默认模式，通常能防止元数据指向尚未写入的新数据。<sup>[5](https://manpages.debian.org/stretch/e2fsprogs/ext3.5.en.html)</sup><sup> • </sup><sup>[4](https://deadsec.team/linux/ext3fs/)</sup>
- **`writeback`**：元数据记入日志，但不保持数据顺序；数据可能在其元数据提交之后才写入主文件系统。据报道这种模式吞吐量最高，能保证文件系统内部完整性，但可能在崩溃和日志恢复后使文件中出现旧数据。<sup>[5](https://manpages.debian.org/stretch/e2fsprogs/ext3.5.en.html)</sup><sup> • </sup><sup>[4](https://deadsec.team/linux/ext3fs/)</sup>

相关的挂载选项可进一步调整行为。`commit=nrsec` 设置所有数据和元数据同步的频率，默认为 5 秒。`barrier=1`（默认值）启用写屏障，强制日志提交在磁盘上按正确顺序进行，使易失性磁盘写缓存在付出一定性能代价的情况下可以安全使用；在使用电池后备的磁盘上，禁用屏障可以安全地提升性能。Ext3 还支持日志配额（第 2 版配额），其优点在于即使发生崩溃也无需进行配额检查。<sup>[5](https://manpages.debian.org/stretch/e2fsprogs/ext3.5.en.html)</sup> 红帽的企业文档对 ext3 仅支持 `data=ordered`。<sup>[6](https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/7/html/storage_administration_guide/ch-ext3)</sup>

## 与 ext2 的兼容性

兼容性目标被描述为 ext2 与 ext3 之间绝对、完全的向后和向前兼容：现有的 ext2 文件系统可以添加日志文件并按 ext3 挂载，无需重新格式化即可获得日志文件系统。<sup>[8](https://compas.cs.stonybrook.edu/~nhonarmand/courses/sp17/cse506/papers/OLS2000-ext3.html)</sup> 反过来，正常卸载的 ext3 文件系统可以按 ext2 重新挂载。与迁移到新的文件系统格式相比，这使得从 ext2 迁移到 ext3 异常容易。<sup>[7](https://www.oreilly.com/library/view/understanding-the-linux/0596002130/ch17s07.html)</sup><sup> • </sup><sup>[6](https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/7/html/storage_administration_guide/ch-ext3)</sup>

日志一致性也涵盖了现有的 ext2 特性：伴随文件更新、扩展或截断的配额操作保证与配额文件内容一致，因此重启后无需进行配额检查，正如无需运行 fsck 一样。<sup>[8](https://compas.cs.stonybrook.edu/~nhonarmand/courses/sp17/cse506/papers/OLS2000-ext3.html)</sup>

## 性能特征

尽管某些数据会被多次写入，但据报道 ext3 在大多数情况下吞吐量高于 ext2，因为其日志功能优化了硬盘磁头的移动。<sup>[6](https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/7/html/storage_administration_guide/ch-ext3)</sup> 2005 年，[威斯康星大学麦迪逊分校](https://www.edgepedia.org/zh/university-of-wisconsin-madison)的 Vijayan Prabhakaran 及其同事利用日志文件系统的语义块分析进行了一项详细研究，发现了 ext3 的设计问题：它将不相关的流量归入同一个复合事务，因此单个磁盘密集型进程会迫使所有写入流量落盘，惩罚了原本异步的写入者；它还通过阻止预提交日志写入与固定位置更新的重叠，人为地限制了并行性。<sup>[9](https://www.usenix.org/legacy/event/usenix05/tech/general/full_papers/prabhakaran/prabhakaran_html/main.html)</sup> 同一项研究表明，ext3 在 ordered 或数据日志模式下会急切地写入，将数据块远早于通常的 30 秒间隔就推送到磁盘。<sup>[9](https://www.usenix.org/legacy/event/usenix05/tech/general/full_papers/prabhakaran/prabhakaran_html/main.html)</sup> 这项威斯康星研究还指出，ext3 的数据日志模式将数据和元数据顺序写入日志，然后再写入其固定位置，在某些令人联想到日志结构文件系统的随机写入工作负载下表现出良好的性能。<sup>[10](https://research.cs.wisc.edu/techreports/2004/TR1509.pdf)</sup>

与 ext2 共享的一项设计原则是避免脆弱的数据结构，限制单个关键块丢失所能造成的损害。这种保守做法为它赢得了可靠而非最快或最具扩展性的文件系统的声誉，而 e2fsck 从严重损坏中恢复的能力被认为对 ext3 的成功至关重要。<sup>[11](https://www.kernel.org/doc/mirror/ols2005v1.pdf)</sup>

## 取证价值

Ext3 将日志引入了 ext 家族，而日志具有取证价值：在 ext 家族文件系统上删除文件时，索引节点中的块指针会被覆盖，因此已删除的文件很难恢复，但日志可能保留块指针完好的旧版索引节点，为恢复这些文件提供了可能性。<sup>[12](https://onlinelibrary.wiley.com/doi/10.1002/9781394289820.ch9)</sup>

## 后继者与移除

Ext4 是 ext3 文件系统的高级版本，融合了针对大型文件系统的可扩展性和可靠性增强，包括 64 位支持。<sup>[13](https://www.kernel.org/doc/html/v6.10/admin-guide/ext4.html)</sup> 由于 ext3 的磁盘格式是 ext4 的子集，ext3 文件系统通过 ext4 驱动访问。<sup>[1](https://docs.kernel.org/filesystems/ext3.html)</sup> 历史悠久的独立 ext3 文件系统驱动于 2015 年 6 月被提交 c290ea01abb7（“fs：移除 ext3 文件系统驱动”）从内核中移除，因为 ext3 分区已由 ext4 驱动完全支持；`EXT3_FS` 配置选项保留了一段时间，仅用于将旧内核配置映射到对应的 ext4 配置，这些选项本身也于 2025 年被移除。<sup>[3](https://lists.openwall.net/linux-ext4/2025/09/26/15)</sup> [红帽企业 Linux](https://www.edgepedia.org/zh/red-hat-enterprise-linux) 7 同样使用统一的 extN 驱动，由 `ext4.ko` 处理 ext2、ext3 和 ext4 磁盘格式，因此无论使用哪种 ext 文件系统，内核消息都指向 ext4。<sup>[6](https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/7/html/storage_administration_guide/ch-ext3)</sup>

## References

1. [Ext3 Filesystem, The Linux Kernel documentation](https://docs.kernel.org/filesystems/ext3.html)
2. [The ext3 Filesystem, Linux Command Line and Scripting documentation](https://distro.ibiblio.org/blacklab/Documentation/linux-commandline-and-scripting.pdf)
3. [linux-ext4: Re: [PATCH] ext4: remove obsolete EXT3 config options](https://lists.openwall.net/linux-ext4/2025/09/26/15)
4. [Ext3 File System in Linux, Geek University](https://deadsec.team/linux/ext3fs/)
5. [ext3(5), e2fsprogs, Debian Manpages](https://manpages.debian.org/stretch/e2fsprogs/ext3.5.en.html)
6. [Chapter 4. The ext3 File System, Red Hat Enterprise Linux 7 Storage Administration Guide](https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/7/html/storage_administration_guide/ch-ext3)
7. [The Ext3 Filesystem, Understanding the Linux Kernel, Second Edition, O'Reilly](https://www.oreilly.com/library/view/understanding-the-linux/0596002130/ch17s07.html)
8. [EXT3, Journaling Filesystem, Ottawa Linux Symposium 2000 transcript](https://compas.cs.stonybrook.edu/~nhonarmand/courses/sp17/cse506/papers/OLS2000-ext3.html)
9. [Analysis and Evolution of Journaling File Systems, USENIX 2005](https://www.usenix.org/legacy/event/usenix05/tech/general/full_papers/prabhakaran/prabhakaran_html/main.html)
10. [Analysis and Evolution of a Journaling File System, University of Wisconsin–Madison TR1509](https://research.cs.wisc.edu/techreports/2004/TR1509.pdf)
11. [State of the Art: Where we are with the Ext3 filesystem, Ottawa Linux Symposium 2005](https://www.kernel.org/doc/mirror/ols2005v1.pdf)
12. [The EXT3/EXT4 File Systems, File System Forensics, Wiley](https://onlinelibrary.wiley.com/doi/10.1002/9781394289820.ch9)
13. [ext4 General Information, The Linux Kernel documentation](https://www.kernel.org/doc/html/v6.10/admin-guide/ext4.html)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 30, 2026; Oct 15, 2026 · Edited: Sep 30, 2026; Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 软件与编程 › Operating systems › File systems

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/ext3

English original: https://www.edgepedia.org/ext3
