LoginSignup
0
0

More than 1 year has passed since last update.

Linux File System

Last updated at Posted at 2021-11-23

Linux File System Evolution

The evolution of the Linux file system:
linux-file-system-timeline.jpg

MINIX File System

The Minix file system supported the Minix operating system. It was first introduced in 1987 by Andrew S. Tanenbaum.

The Minix operating system and its file system were mostly used for educational coding purposes. The performance of the file system was not up to standard at the time. Filename lengths were restricted to fourteen characters, and partitions were limited to 64MB. At the time, hard drives supported partitions up to 140MB.

By 1992 Minix was mostly out of use due to lack of performance and development of the ext file system.

ext File System

The ext file system stands for “Extended File System”. It was the first file system designed to support the Linux kernel.

Virtual File System (VFS) was used for the ext file system. Its primary purpose was to allow the Linux kernel to access the ext file system. The ext file system restricted filename lengths to 255 characters and supported partitions up to 2GB.

While it managed to solve issues that the Minix file system had, it had one major flaw – timestamping. Unlike today where each Linux file has three timestamps (access timestamp, modified timestamp, and changed timestamp), the ext file system allowed only one timestamp per file.

In January 1993, the ext2 file system was introduced. In time, all users switched from ext to ext2.

ext2 File System

Remi Card designed the ext2 file system and released it in January 1993, less than a year after introducing the ext file system.

The ext2 file system enabled the retention of the internal structure while the file system functionalities extended. Data from files were kept in data blocks of the same length. The ext2 file system supported the maximum file size of 2TiB. Filename lengths were not limited in characters, but in bytes – 255 bytes. It did not support journaling.

While this file system was largely used, it still had two major issues:

File corruption – This phenomenon would occur if data were written to the disk at the time of a power loss or system crash.
Performance loss – Disk fragmentation happens when a single file is broken into pieces and spread over several locations on the disk. As a result, files take longer to read and write, which leads to performance degradation.`

The ext2 system was mostly used until the early 2000s when the ext3 file system was introduced. It is occasionally used today for USB devices because it does not support the journaling system.

ext3 File System

Stephen Tweedie designed the ext3 file system (Third Extended File System). It launched in November 2001 with Linux kernel 2.4.15. It is still in use today.

The ext3 file system is an improved version of ext2 file system. It supports a maximum file size of 2TiB and restricts maximum filename length to 255 bytes, like the ext2 file system. The improvement is reflected in journaling.

The journaling system keeps a “journal” of all changes in the data structure that are yet to be commited. In case of power loss or system crash, logs stored via the journaling system return data in a manner of seconds, reducing the risk of corruption or data loss. The system writes the data in the correct areas of the file system when the log is updated.

The Linux kernel supports three levels of journaling:

Journal – It consists of writing metadata and file contents in a journal before changes are made to the main file system. This saves data in case of a power loss or system crash. The disadvantage of this level of journaling is that the performance of the system declines.
Ordered – This journaling level writes the metadata to the journal, while file contents are automatically stored in the main file system. The process is performed in a specific order. First, the metadata is written in the journal. Then, the file contents are written to the main file system. Eventually, the metadata connects to the main file system. Therefore, the main file system is not corrupted in the event of a system crash. Only files that are in the process of being written during a crash can be corrupted.
Writeback – This level of journaling only writes metadata to the journal. File contents are written to the main file system only after the journal is updated. Due to the lack of synchronization of metadata and file content, the file system will likely be corrupted if the system crashes.

ext4 File System

The ext4 file system is the default file system of the current Linux kernel. It was introduced in October 2008 with Linux kernel 2.6.28.

The ext4 file system supports the maximum file size of 16TiB and restricts maximum filename lengths to 255 bytes.

ext4 File System

Features of the ext4 File System

ext4-main-features.png

Limitations of ext4 File System

Although the ext4 file system is considered as the best file system for Linux distributions, there are a few limitations that should be considered in the further development of the system:

Corrupted data recovery – The ext4 file system cannot detect or recover corrupted data already written on the disk.
Maximum volume size – The maximum volume size is set to 1 EiB. However, the file system cannot address more than 100 TiB of data without a significant loss of performance and increased disk fragmentation.

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0