Ext4

From Gentoo Wiki
Jump to:navigation Jump to:search
This page is a translated version of the page Ext4 and the translation is 73% complete.
Outdated translations are marked like this.
Other languages:


Resources

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

Initially created as a fork of ext3, ext4 brings new features, performance improvements, and removal of size limits with moderate changes to the on-disk format. It can span volumes up to 1 EB and with maximum file size of 16TB. Instead of the classic ext2/3 bitmap block allocation, ext4 uses extents, which improve large file performance and reduce fragmentation. Ext4 also provides more sophisticated block allocation algorithms (delayed allocation and multiblock allocation) giving the filesystem driver more ways to optimize the layout of data on the disk.

安装

内核

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

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

可选的 ext4 特性支持:

内核 启用可选的 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 时使用(仅限高级用户).

! Option ! Description |-

| Ext4 POSIX Access Control Lists | Enable ACL permissions. |-

| Ext4 Security Labels | Enable POSIX capabilities support. |-

| EXT4 debugging support | (Not recommend) Use when debugging ext4 (advanced users only). |-

|}

大型设备支持

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

内核 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 gettext - GNU locale utilities)
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 闪存设备设计的文件系统

外部资源