What is Ext (Ext2, Ext3, Ext4) File System?

Quick Insight

The Extended File System, or Ext, is the core storage frame for Linux. It keeps your data safe through journaling, which logs each change before it goes to disk. Ext4, the newest step in this line, supports bigger files and runs faster than older types. But even Ext2 gives you a stable setup with a straight inode layout for basic use. This family of tools cuts the risk of data loss on your machine. So, you get a trusted space for both small home work and big business loads.

The Extended File System (Ext) is a key part of the Linux system. It is famous for being fast and very secure. It first came out in 1992 and has been updated many times. Ext4 is the newest and best version.

Ext4 has mostly taken over from older types. This is because it works better and holds bigger files. But Ext is still ubiquitous in many Linux versions. It has imcrucialools like journaling. This keeps your data safe by logging changes first.

In all, this dependability has made Ext a popular pick. It works well for home users and big companies. So, it continues its important role in the Linux world.

Ext File System Definition and Features

What are Linux Ext File Systems?

1. Ext (Extended File System)

Rémy Card made the Ext file system in April 1992. Frankly, it was a big step forward. It was created for the Linux kernel and was based on the Unix operating system.

It also tried to fix the problems of the MINIX system. Because of this, Ext was a pioneer and the first of its kind.

In 1993, it became the base for later systems like Ext2 and Xiafs. Both of these used their original design. Of these, Ext2 became very popular.

People used Ext2 for a long time. It fixed inode problems and file fragmentation. These were the main flaws in the first Ext system.

Consequently, Ext2 became the top choice for many users. This progress improved file structure technology for Linux significantly.

2. Ext2 (Second Extended System)

Ext2, or the Second Extended File System, was made by Rémy Card for Linux. It is flexible and can be expanded. It is now a fundamental part of Linux and is used by most Linux systems.

The Ext2 system handles file data by putting it into the same-sized blocks. These blocks are the same size in one system, but can be different in others. The block size is chosen when you make the file structure with “mke2fs”.

When saving files, Ext2 makes the document’s size fit a whole number of blocks. For example, with a 1024-byte block, a 1025-byte file will use two blocks. This wastes a little bit of space.

Not all blocks are for user files; some hold essential data about the system itself. This data is needed for the file structure to work well.

Every Ext2 system is built on an “inode” structure. This is very important for how the system is arranged. An inode has details about a document, like where its data is, its permissions, time stamps, and its type.

Each document has its own inode, marked by a unique number. The inodes are kept in lists called inode tables for fast access.

Folders in Ext2 are special files that have links to the inodes of other files and folders inside them. This setup allows for easy finding and opening of files, making Ext2 a strong and trusted system.

Ext2 Data Structures

The Ext2 file system neatly divides storage into separate blocks. These blocks are then put into cylinder groups. This plan helps to reduce scattered files and limits how often the disk must search, especially for large pieces of data.

Every block has a specific job. It holds a superblock group, a bitmap block group, and an inode bitmap, then the fundamental data blocks for user files and folders.

The superblock is very important. It has key details needed to start the operating system. For safety, many copies of the superblock are made in each cylinder group. But, only the main copy in the first block is used when the system starts.

Also, the identifier group is very important. It records the starting place for the bitmap block, inode bitmap, and inode table inside each block group.

This setup is saved in the identifier group’s table, which helps find and manage data quickly.

Every inode holds a lot of details, such as:

  • The inode number, a unique name for files and folders.
  • The file type, showing if it is a regular file, folder, link, or something else.
  • The file’s owner, the user who made or controls it.
  • The file’s permissions, which say who can read, change, or run the document.
  • The creation date, the time when the file was first made.

This well-planned design of the Ext2 file structure makes data handling efficient and keeps the storage structure safe.

File System Limits

The Ext2 system has some limits from its file format. These limits also come from the operating system itself. They are decided when the system is made. This affects how files are handled and used.

One key feature of the Ext2 system is its block size. The standard alpha setup allows the most enormous block size of 8 KB. But this is different for other computer types.

Also, many programs have trouble with files bigger than 2 GB. This can be a problem for people using extensive data or video files.

For the number of files in a folder, the smallest limit is about 32,768. Users should be careful. Folders with 10,000 to 15,000 files often cause alerts. These alerts mean file tasks may become slow. Because of this, speed can get worse with too many items.

The idea-based top limit for files in a folder is huge: 1.3 × 10^20. But this number is not helpful in real life. Users usually see major speed problems far before they get near this limit.

3. Ext3 (Third Extended File System)

Ext3 is a third extended file system. It includes logging features. Moreover, it is the most widely used document system in Linux distributions.

Although Ext4 now replaces Ext3. The biggest change from Ext2 to Ext3 is journaling. An Ext3 system can install and use an Ext2 system.

Another critical difference is that Ext3 uses a balanced binary tree. Specifically, it uses an AVL tree and includes the Orlov disk block mapper.

Additionally, Ext3 partitions have the same file structure as Ext2. Therefore, you can switch from Ext2 to Ext3 easily. This is useful, especially if the registry gets accidentally corrupted. This can happen due to corrupt sectors on the disk.

In summary, there is full compatibility between Ext2 and Ext3. You can convert Ext2 to Ext3 or vice versa. Since the disk format remains unchanged, you can also configure the Ext3 system as Ext2.

Ext3 Advantages

Even though it is slower and cannot grow as much as others, it has benefits. For example, you can change from Ext2 to Ext3 very simply. This change lets you keep all your saved information secure, without having to erase the disk.

Also, it uses less of the computer’s main power. Ext3 is also seen as more secure than other Linux file systems. Its simpler design and much longer testing time help make it safer.

Also, Ext3 adds a journal to Ext2. It also has tree-shaped folders and lets those folders get bigger while the system is running.

1. Ext3 Limits

Ext3 has two separate size limits. One limit is for a single document. The other limit is for the whole system. In detail, the size limit is 2 billion, 147 million, 483 thousand, and 647 blocks.

2. Journaling Levels

  • Journal (Low Risk)

File details and content are copied to the journal first. This is done before they are moved to the central system. The journal is always on the disk, which can sometimes make things faster.

But other times, it can make things slower. This is because the data must be saved twice. First, it is saved in the journal, and then in the central system.

  • Ordered (Medium Risk)

In this way, only file details are saved in the journal. The file content is written to the disk first. This happens before the related information is marked as saved in the journal.

This way is the standard in most Linux systems. If the power goes out while saving, some data might be lost. Because of this, the cleanup step will delete any unfinished files.

  • Writeback (High Risk)

Here, only file details are recorded. The actual content of the files is not saved in the journal. Content can be saved before or after the journal is updated.

Because of this, files can be damaged if something goes wrong. For example, a document that is waiting to be logged might be huge. This file could be removed after the system is checked.

After fixing the journal, old copies of files might show up again. Luckily, many problems from poor timing are fixed quickly. JFS uses this level but removes unneeded items on restart.

Ext3 Disadvantages

1. What It Does

Ext3 works with Ext2. So, its file structures are a lot like Ext2. But Ext3 does not have many parts of newer systems. These are things like extensions, moving inodes, and block sub-location.

Every folder can have 31,998 sub-folders. This limit exists because each inode has 32 links.

Like most Linux file systems, you cannot run fsck on Ext3 while it is in use. If you check a mounted system, you might see wrong mistakes. It might also try to correct these mistakes. But this could leave the file structure the same.

2. File Scattering

There is no online tool to fix scattering for Ext3. Instead, an offline tool named E2defrag exists, but you must first change the system back to Ext2.

Using e2defrag could erase your data. Still, there are user tools, like Shake and Defrag, that can help. Shake looks for the whole file as a task. This often ends with it always looking for free space on the disk.

Defrag copies every file over itself. But both tools only work if the file system has nothing on it. Mostly, there is no perfect tool to fix scattering for this version.

Some systems, like Ext3, look for the closest free blocks for a file. So, you do not need to worry much about scattering on a Linux system. Even though Ext3 fights scattering well, systems can still get worse after a long time.

Because of this, Ext3 can work with extensions in nearby file areas.

3. Making Files Smaller

You can make files smaller with an unofficial patch for Ext3. This patch is a direct copy of e2compr. More work is needed because it cannot yet use a journal.

4. Safety and Control

Ext3 does not check for errors during journaling. If “barrier=1” is not set as an option, hardware damage can happen. In this situation, there is a danger of significant file structure damage during a sudden hardware crash.

Windows and Ext3

Although Windows lacks native support for Ext2 or Ext3, you can install drivers. These drivers allow access to such file systems on all x86 Windows systems.

Furthermore, this setup allows you to assemble partitions without separate programs. It displays the file structure as if it were another Windows partition.

Alternatively, you can use a program to view and copy files. This option does not mount the partition, yet it accesses Ext3 and Ext2 files.

The following are programs that enable access to the Ext system on your Windows system:

  1. Ext2explore (Ext2Read)
  2. DiskInternals Linux Reader
  3. Ext2Fsd

4. Ext4 (Fourth Extended File System)

An Ext4 system is fault-tolerant. This is because data integrity is ensured. Changes in the metadata are first journaled.

Since Linux 2.6.28, the kernel officially supports Ext4. The Ext4 release date is 2008. Notably, Ext4 is an enhanced version of Ext2 and Ext3. Some critical data structures have changed. Additionally, only registry functionality was added.

Furthermore, Ext4 provides better performance and reliability. It also offers richer features.

You can switch from Ext2 and Ext3 to Ext4 easily. By applying a few commands, you avoid formatting the disk. You also do not need to reboot the system. Ext4 retains its original data structure. Moreover, it handles new data effectively.

Currently, Ext4 supports a 1 EB (1024 TB) system. It also supports a maximum file size of 16 TB. In comparison, Ext3 supports a maximum file size of 2 TB.

However, Ext4 supports an unlimited number of subdirectories. In contrast, Ext3 currently only supports 32,000 subdirectories.

When writing data to the Ext3 file system, the block mapper allocates a 4 KB block. This occurs whenever it maps. Writing a 100 MB file calls the burst mapper 25,600 times.

Additionally, it uses an MBALLOC (Multi-Block Mapper) to map multiple data blocks.

How It Manages Delays

It uses a plan for giving out data blocks. This makes giving them out very fast.

Ext4 and other new systems wait to assign cache space. They wait until the file’s blocks are set and ready to be saved.

Because of this, you can improve the first two parts of the data blocks. This improvement can make file placement and total speed much better.

Fast Disk Checking

The fsck tool can be very slow. First, it must look at every single file listing.

But Ext4 adds a list of unused inodes to every group’s inode table.

Checking the Journal

The journal part is used the most. Sadly, it can often lead to a broken hard drive.

Also, damage to the journal’s data can cause more data to be lost.

The Ext4 journal feature checks the data log easily. It finds out if any damage has happened. The Ext3 two-step process logs in one step. This switch makes things faster.

Turning Off the Journal

The journal can often get too full. But Ext4 lets you turn the journal off.

This choice can make things faster for users with special jobs.

Fixing Fragmentation While Running

Even with delayed placement, using many groups helps. This method can lower document system scattering.

But, cattering will still happen over time.

Ext4 lets you fix scattering while the system is on. It has a tool called e4defrag for single files or the whole system.

Inode Details

Ext4 supports very large inodes. It has also been changed to hold more details in each inode.

Also, Ext4 allows for easy adding of new features and more inode storage.

Built-in Memory Cache

It has a built-in memory area for disk tasks. This area re-saves data to make things faster.

So, the file system must save data to the disk after it is logged.

If the journal’s confirmation is saved first, the journal could break. Also, this can put the safety of your data at risk.

By default, Ext4 turns on the barrier. But, when all the data is prepared, it can save data after the barrier.

If you want to try an advanced file system, I recommend reading our article What is ZFS. This structure can store large amounts of data and check the accuracy of your data. It also includes built-in RAID features. This makes ZFS a more powerful option than older systems such as Ext.

They'll Thank You for Discovering This Guide!

Ready to do your loved ones a huge favor with just one click? Knowledge grows as it is shared.

Be the first to share your comment