Features / Difference Of Linux Ext2 Ext3 Ext4 Filesystem

September 7, 2012 | By
| Reply More

Ext Filesystem

A filesystem is a way of storing, organizing and accessing files (and/or directories) on a storage device. Some examples of filesystems are FAT, NTFS for Windows/DOS, HFS for MAC OS etc. In Linux, the popular filesystems are ext2, ext3 and ext4 filesystems. Some other filesystems such as ReiserFS are also natively supported by Linux. This article discusses various features of extended filesystems in Linux, i.e. ext2, ext3 and ext4.

ext2 - Second Extended Filesystem

The extended filesystem, ext, implemented in Linux in 1992 was the first filesystem designed specifically for Linux. ext2 filesystem is the second extended filesystem. It was default filesystem in many Linux distros for many years. Features of ext2 are:

• Developed by Remi Card
• Introduced in January 1993
• Replacement for extended filesystem
• Maximum file size: 16GiB - 2TiB, depending upon block size (1K, 2K, 4K or 8K)
• Maximum volume/filesystem size: 2TiB - 32TiB
• Maximum filename length: 255 bytes (255 characters)
• Maximum number of files: 10^18
• Filenames: All characters except NULL('\0') and '/' are allowed in a file name
• Date range: December 14, 1901 - January 18, 2038

ext3 - Third Extended Filesystem

With ext3, the concept of journaling was introduced. With ext2 filesystem, when system crashed, or power failure occurred, the whole filesystem needed to be checked for consistency and bad blocks. With journaling, the filesystem keeps track of the changes made in the filesystem before committing them to filesystem. These changes are stored at a specified location in a dedicated area of the filesystem. So in the event of power failure or system crash, the filesystems can be brought back much quickly.
ext3 filesystem is fully compatible with its previous version, i.e. ext2 filesystem. The other features are:

• Developed by Stephen Tweedie
• Introduced in November 2001 (with Linux 2.4.15)
• Journaled filesystem.
• An ext2 filesystem can be converted to ext3 without any need of backup.
• Maximum file size: 16GiB - 2TiB
• Maximum volume/filesystem size: 2TiB - 32TiB
• Maximum filename length: 255 bytes (255 characters)
• Maximum number of files: Variable
• Filenames: All characters except NULL('\0') and '/' are allowed
• Date range: December 14, 1901 - January 18, 2038

You can convert an ext2 filesystem to ext3 with the following commands issued by root only:
First of all unmount the volume you want to convert from ext2 to ext3.

# umount /dev/sda2

Convert from ext2 to ext3 with tune2fs command:

# tune2fs -j /dev/sda2

Mount back your filesystem:

# mount /dev/sda2 /mnt

This conversion can also be performed on a live filesystem as well. So you can run the tune2fs command without unmounting the filesystem.

ext4 - Fourth extended filesystem

The ext4 filesystem, developed as an extension to ext3 is the newest filesystem in the series of extended filesystems (ext's). It has many performance improvements over ext3. In most modern distros, the default filesystem is ext4. The features are:

• Developers: Mingming Cao, Andreas Dilger, Alex Zhuravlev (Tomas), Dave Kleikamp, Theodore Ts'o, Eric Sandeen, Sam Naghshineh and others (from wikipedia.org)
• Introduced in October 2008 (stable)
• Journaled filesystem
• Performance enhancements over its predecessor (ext3)
• Maximum file size: 16TB
• Maximum volume/filesystem size: 1EIB (exabyte) (1Eib = 1024PiB, 1PiB = 1024TiB, 1TiB = 1024GiB)
• Maximum filename length: 255 bytes (255 characters)
• Maximum number of files: 4 billion
• Filenames: All characters except NULL('\0') and '/' are allowed
• Date range: December 14, 1901 - April 25, 2514
• Total filesystem check time improved (fsck time)

An ext3 filesystem can be converted to ext4 filesystem with the following command:

# tune2fs -O extents,uninit_bg,dir_index /dev/DEV

Where /dev/DEV must be replaced with the appropriate device such as /dev/sda2.

Updated: December 14, 2014

Linux 3.19 kernel bring with lots of big fixes on ext4 and much enhancement for cpu utilization/potential soft lockups when under heavy memory pressure.

Filed Under : FILE SYSTEM, HOWTOS, LINUX HOWTO

Tagged With :

Free Linux Ebook to Download

Leave a Reply

Commenting Policy:
Promotion of your products ? Comment gets deleted.
All comments are subject to moderation.