ext4/zh-cn
Warning: Display title "ext4/zh-cn" overrides earlier display title "Ext4".
ext4 (第四代扩展文件系统) 是 一个开源的磁盘文件系统并且是扩展系列文件系统的最新版本。它是许多 Linux 系统使用的主文件系统,这使其成为 Linux 中可以说是支持最稳定且经过良好测试的文件系统。
安装
内核
激活以下内核选项来启用 ext4 支持:
File systems ---> <*> The Extended 4 (ext4) filesystem
可选的 ext4 特性支持:
File systems ---> [*] Ext4 POSIX Access Control Lists [*] Ext4 Security Labels [ ] EXT4 debugging support
选项 | 描述 |
---|---|
Ext4 POSIX Access Control Lists | 启用 ACL 权限. |
Ext4 Security Labels | 启用 POSIX capabilities 支持. |
EXT4 debugging support | (不推荐) 调试 ext4 时使用(仅限高级用户). |
大型设备支持
当系统有大容量硬盘 (2 TB 或更大 ) 并且使用 32 位 (x86) 内核时, 下列选项必须启用:
-*- Enable the block layer ---> [*] Support for large (2TB+) block devices and files
USE 标记
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 |
test
|
Enable dependencies and/or preparations necessary to run tests (usually controlled by FEATURES=test but can be toggled independently) |
tools
|
Build extfs tools (mke2fs, e2fsck, tune2fs, etc.) |
Emerge
配置 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
另请参阅
- Ext4 encryption — provides instructions on encrypting files in a home partition using the ext4 filesystem's built-in file based encryption.
- JFS — 一个由 IBM 创造的 64 位日志文件系统
- Btrfs — 一个写入时复制(CoW) 的 Linux 文件系统 ,旨在实现高级功能的同时专注于容错、修复和易于管理。
- XFS — 一个高性能日志文件系统
- F2FS — 一个为基于 NAND 闪存设备设计的文件系统。