ext4
ext4 (fourth extended file system) はオープンソースのディスクファイルシステムで、extended filesystem シリーズの最新バージョンです。これは多くの Linux システムで主要なファイルシステムとして使用されていることから、Linux でサポートされている中でほぼ間違いなく最も安定し、かつ十分にテストされたファイルシステムとなっています。
ext4 は当初 ext3 のフォークとして作成され、パフォーマンスの改善と、ディスク上のフォーマットへのわずかな変更を伴うサイズ制限の撤廃という、新しい機能を取り入れました。ボリュームの上限は 1 EB に、ファイルサイズの上限は 16TB に拡大されました。古典的な ext2/3 ビットマップブロック割り当てに代わって、ext4 はエクステントを使用し、大きいファイルのパフォーマンスを向上させつつ断片化を抑制します。ext4 はより洗練されたブロック割り当てアルゴリズム (遅延割り当てとマルチブロック割り当て) も提供し、ファイルシステムドライバがディスク上のデータのレイアウトをより最適化できるようにしています。
インストール
カーネル
ext4 をサポートするには、以下のカーネルオプションを有効にしてください:
File systems --->
<*> The Extended 4 (ext4) filesystem
ext4 のオプション機能をサポートするには:
File systems --->
[*] Ext4 POSIX Access Control Lists
[*] Ext4 Security Labels
[ ] EXT4 debugging support
Ext3
A normal ext4 system will not need to enable ext3 or ext2 options. These options are here solely for historical purposes.
Activate the following kernel options for ext3 support:
File systems --->
<*> Ext3 journalling file system support
Support for optional ext3 features:
File systems --->
[*] Default to 'data=ordered' in ext3
[*] Ext3 extended attributes
[*] Ext3 POSIX Access Control Lists
[*] Ext3 Security Labels
Ext2
Ext2 does not have journaling, support for this was added in Ext3
Activate the following kernel options for ext2 support:
File systems --->
<*> Second extended fs support
Support for optional ext2 features:
File systems --->
[*] Ext2 extended attributes
[*] Ext2 POSIX Access Control Lists
[*] Ext2 Security Labels
The original ext3 filesystem code was removed from the Linux Kernel with version 4.3, instead the ext4 filesystem code can now handle ext2, ext3 and ext4 filesystems. It will maintain compatibility if the filesystem is mounted as ext2 or ext3, and will provide upgradability when mounted as ext4. Additionally tune2fs can be used to add ext3- and ext4-specific features to an existing ext2 or ext3 filesystem, though certain hard limits will remain.
The original ext2 filesystem code remains available.
Both ext2 and ext3 file timestamps are affected by the year 2038 problem, while ext4 is Y2k38-safe since 2016, Kernel 4.3.6 and e2fsprogs 1.43.
大容量ドライブのサポート
-*- Enable the block layer --->
[*] Support for large (2TB+) block devices and files
USE フラグ
USE flags for sys-fs/e2fsprogs Standard EXT2/EXT3/EXT4 filesystem utilities
archive
|
Add support for mke2fs to read a tarball as input. This allows not needing privileges. Needs app-arch/libarchive. |
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
The sys-fs/e2fsprogs package and should be available as part of the default system set.
root #
emerge --ask sys-fs/e2fsprogs
使い方
作成
mkfs.ext4 コマンドはフォーマットするよう指示されたパーティションの全ての内容を不可逆的に破壊します。正しいパーティションを選択しているか必ず確認してください!
ext4 ファイルシステムを /dev/sda1 パーティションに作成するには:
root #
mkfs.ext4 /dev/sda1
Mounting
See filesystem.
Utilities
Utilities included in the package consist of:
Utility | Description | Man page |
---|---|---|
badblocks | A small program for stress testing block devices. | Man page |
debugfs | An ext2/ext3/ext4 file system debugger. | Man page |
dumpe2fs | A tool to dump ext2/ext3/ext4 filesystem information. | Man page |
e2fsck | A tool for checking ext2/ext3/ext4 filesystems. | Man page |
e2image | A tool for saving critical ext2/ext3/ext4 filesystem metadata to a file. | Man page |
e2label | A tool to change the label on an ext2/ext3/ext4 filesystem (symlinks to tune2fs). | |
e2undo | A tool to replay an undo log for an ext2/ext3/ext4 filesystem. | Man page |
fsck.ext2 | Checks, specifically, an ext2 filesystem (symlinks to e2fsck). | |
fsck.ext3 | Checks, specifically, an ext3 filesystem (symlinks to e2fsck). | |
fsck.ext4 | Checks, specifically, an ext4 filesystem (symlinks to e2fsck). | |
fsck.ext4dev | Checks, specifically, an ext4dev filesystem (symlinks to e2fsck). | |
logsave | A tool to save the output of a command in a logfile. | Man page |
mke2fs | The base program for creating ext2/ext3/ext4 filesystems. Creation commands symlink here. | Man page |
mkfs.ext2 | Creates, specifically, an ext2 filesystem (symlinks to mke2fs). | |
mkfs.ext3 | Creates, specifically, an ext3 filesystem (symlinks to mke2fs). | |
mkfs.ext4 | Creates, specifically, an ext4 filesystem (symlinks to mke2fs). | |
mkfs.ext4dev | Creates, specifically, an ext24dev filesystem (symlinks to mke2fs). | |
resize2fs | An ext2/ext3/ext4 filesystem resizer. | Man page |
tune2fs | Adjust tunable filesystem parameters on ext2/ext3/ext4 filesystems. | Man page |
Utility | Description | Man page |
---|---|---|
chattr | Change file attributes on a Linux filesystem. | Man page |
lsattr | List file attributes on a Linux second extended filesystem. | Man page |
Utility | Description | Man page |
---|---|---|
e2freefrag | Report free space fragmentation information. | Man page |
e4defrag | An online defragmenter for ext4 filesystem. | Man page |
filefrag | Report on file fragmentation. | Man page |
mklost+found | Create a lost+found directory on a mounted Linux second extended filesystem. | Man page |
関連項目
- XFS — 高性能なジャーナリングファイルシステム
- Btrfs — 耐障害性、自己修復特性、管理のしやすさに焦点を当てつつ、先進的な機能を実装することも主眼としている、Linux 向けのコピーオンライト (CoW) ファイルシステムです。
- FAT — 当初は MS-DOS (および後の NT 以前の Microsoft Windows) で使用するために作られたファイルシステム。
外部資料
- https://ext4.wiki.kernel.org/ - The second, third, and fourth extended file system wiki
- https://bugzilla.kernel.org/show_bug.cgi?id=23732 - The final fix for the Year 2038 problem, only for ext4.