Ext4
ext4 (Quatrième système de fichier étendu) est un système de fichier open-source et la version la plus récente dee la série des systèmes de fichiers étendus. C'est le système de fichier principal utilisé par de nombreux systèmes linux, pouvant être considéré à raison comme l'un des plus stables et des plus testés dans 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.
Installation
Kernel
Activate the following kernel options for ext4 support:
File systems --->
<*> The Extended 4 (ext4) filesystem
Support for optional ext4 features:
File systems --->
[*] Ext4 POSIX Access Control Lists
[*] Ext4 Security Labels
[ ] EXT4 debugging support
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). |
Large drive support
When the system has large disks (2 TB or greater) and a 32-bit (x86) kernel is being used, the following option must be enabled:
-*- 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 gettext - GNU 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
After setting the USE flag update the system so the changes take effect:
root #
emerge --ask --changed-use --deep @world
Usage
Creation
The mkfs.ext4 command irreversibly destroys any content of the partition it is told to format. Be sure to select the right partition!
To create an ext4 filesystem on the /dev/sda1 partition:
root #
mkfs.ext4 /dev/sda1
Please replace /dev/sda1 with the actual partition to format.
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
See also
- Ext4 encryption — provides instructions on encrypting files in a home partition using the ext4 filesystem's built-in file based encryption.
- JFS — a 64-bit journaling filesystem created by IBM.
- Btrfs — un système de fichiers fondé sur le copie sur écriture (CoW) pour Linux visant à implémenter des fonctionnalités complexes tout en mettant l'accent sur la tolérance aux pannes, la réparation et la facilité d'administration.
- XFS — un système de fichiers journalisé de haute performance
- F2FS — a filesystem designed for NAND flash-based devices.