From Gentoo Wiki
Jump to: navigation, search
This page is a translated version of the page Ext4 and the translation is 90% complete.

Outdated translations are marked like this.
Other languages:
English • ‎русский • ‎中文(中国大陆)‎ • ‎日本語

Warning: Display title "ext4/zh-cn" overrides earlier display title "Ext4".


ext4 (第四代扩展文件系统) 是 一个开源的磁盘文件系统并且是扩展系列文件系统的最新版本。它是许多 Linux 系统使用的主文件系统,这使其成为 Linux 中可以说是支持最稳定且经过良好测试的文件系统。



激活以下内核选项来启用 ext4 支持:

KERNEL 启用 ext4 支持
File systems  --->
   <*> The Extended 4 (ext4) filesystem

可选的 ext4 特性支持:

KERNEL 启用可选的 ext4 特性支持
File systems  --->
   [*]   Ext4 POSIX Access Control Lists
   [*]   Ext4 Security Labels
   [ ]   EXT4 debugging support
可选 ext4 支持的定义
选项 描述
Ext4 POSIX Access Control Lists 启用 ACL 权限.
Ext4 Security Labels 启用 POSIX capabilities 支持.
EXT4 debugging support (不推荐) 调试 ext4 时使用(仅限高级用户).


当系统有大容量硬盘 (2 TB 或更大 ) 并且使用 32 位 (x86) 内核时, 下列选项必须启用:

KERNEL x86 内核启用大型设备
-*- Enable the block layer  --->
    [*]   Support for large (2TB+) block devices and files

USE flags

The sys-fs/e2fsprogs package contains the utilities to work with the filesystem. In Gentoo Linux sys-fs/e2fsprogs is part of the system set and should be already installed on the system.

USE flags for sys-fs/e2fsprogs Standard EXT2/EXT3/EXT4 filesystem utilities

cron Install e2scrub_all cron script
fuse Build fuse2fs, a FUSE file system client for ext2/ext3/ext4 file systems
nls Add Native Language Support (using gettextGNU locale utilities)
split-usr Enable behavior to support maintaining /bin, /lib*, /sbin and /usr/sbin separately from /usr/bin and /usr/lib*
static-libs Build static versions of dynamic libraries as well


配置 USE flag 以后,更新系统来使得某些配置生效。

root #emerge --ask --changed-use --deep @world



mkfs.ext4 命令不可恢复地破坏了要格式化的分区所有内容。请确保您选择了正确的分区!

/dev/sda1 分区创建一个 ext4 文件系统:

root #mkfs.ext4 /dev/sda1

请使用实际要格式化的分区替换 /dev/sda1

By default, 5% of available disk space is reserved for the root user. This is usually a good thing for the partition where the / directory is mounted, but it may be not desirable on other partitions. To lose reserve disk space for the root user use mkfs.ext4's -m 0 option:

root #mkfs.ext4 -m 0 /dev/sda1