Each file system has its advantages and disadvantages. In this article, we will take a detailed look at the features of the EXT (Ext 2, Ext3 Ext4) Linux File System.
- What is the EXT file system?
- Evolution of the EXT file system. The changing history in versions.
- Features of the Ext4 file system
- Advantages and disadvantages of the Ext4 file system
- The EXT file system structure
- Is it worth turning off journaling
- How to open an EXT drive in Windows?
- The best alternatives to the EXT file system
What is the EXT file system?
The EXT (Extended File System) file system was designed especially for the Linux operating system. The main goal that the creators of EXT had in mind was to overcome the maximum size of writable files, which at that time, was 64 MB only. Thanks to creating a new metadata structure, the maximum possible file size was increased to 2GB. At the same time, the maximum length of file names increased to 255 bytes.
Remy Card, the chief designer of the EXT file system, admired the UFS file system, so some of its features were passed on to EXT.
Even though Linux supports a large number of file systems, EXT is preferred since it was built on the Linux kernel.
Although EXT overcame the main drawbacks of the Minix file system (which was used in Linux at the time), its main drawback was the timestamps. EXT allowed only one timestamp per file. For this reason, EXT‘s development continued, and in later versions, it was constantly evolving and adding new features.
It became very popular not only among Linux users but also among Android smartphone owners. That is why Android uses the Ext4 file system by default.
Evolution of the EXT file system. The changing history in versions.
As mentioned above – although EXT overcame the limitations of the Minix file system, it still had a lot of drawbacks. That is why the development of EXT did not stop, and three more versions were added in the future.
Just like the previous one, Ext2 was created by Remy Card. This file system saw the world in January 1993.
The most important innovation was that now data is written in blocks of equal length. It allowed increasing the filesystem performance significantly. Besides, the usage of data blocks allows for increasing the maximal size of the stored files. Now it was 2 TB instead of 2 GB. The file name length was still 255 bytes.
But the Ext2 had quite a few disadvantages. The biggest issue was the lack of Journaling. If a power failure happened while writing the files to the disk, the file system would get corrupted, and it was quite hard to recover.
In some cases, the lack of journaling was a definite plus. For example, Ext2 is faster than Ext3. That is why in some cases, Ext2 is still in use today. Also, the lack of journaling reduces the load on SSD drives. That is why some companies use Ext2 and use RAID as data protection.
For more details about RAID, you can read the article “RAID – what is it and how you can use it?“
One more drawback of the Ext2 file system was high data fragmentation which lead to a performance loss. That is, during writing the file was split into several parts, and then they were written in different parts of the hard drive. Thus, the reading process took longer. The more information was stored on the disk — the lower was the speed of reading/writing data.
That is why the development of the EXT file system didn’t stop at this version and in November 2001 the next version – Ext3 – appeared.
The Ext3 file system is an improved version of Ext2. Information is still written in data blocks of the same length, and the maximum file size remains the same – 2TB.
However, it includes journaling, a technology that significantly reduces the risk of data loss.
The essence is the following – the file system marks all planned changes in the data structure. In case of power loss, the system instantly reads the information from the “journal” and the files are not lost.
Ext3 supports three levels of journaling:
- Journal – the file system writes both metadata and user data to the journal, thereby virtually guaranteeing successful file system recovery in the event of a power loss. At the same time, this method most severely degrades file system performance.
- Writeback – first, the metadata is written to the log, and only then, the information is written to the file system. There is no synchronization of metadata and information in the file system. This level of journaling is the fastest since there is no need for validation. The main disadvantage however is that if something happens to the system, you will lose the data.
- Ordered (ordered journaling) – the writing process is done in a certain order: first, the metadata is written to the log, then the user data is written to the file system. After that, the metadata is connected to the files on the disk. In the case of a power failure, only the files written to the disk at that moment “disappear”. The file system structure is not damaged.
The Ext3 file system became quite popular and was used until the next version – Ext4.
Ext4 – was introduced in 2008 and is currently the latest version of the EXT file system. It uses basic principles of Ext3, but the speed has been increased significantly (it’s even faster than in Ext2), the maximum file size has been increased to 16 GB, support for drives up to 1 Exabyte has been added, and much more.
There are quite a lot of innovations. Go to the next point in this article to read about them.
Features of the Ext4 file system
Although the Ext4 file system uses the basic concepts of Ext3, it has a lot of innovations that have made it so popular
For first, the space-based file recording method is used in Ext4 to increase the performance. It means that before the file is written to the disk, the filesystem allocates the surface area, and then write the data to the end of that one.
The Ext4 file system has added backward compatibility with Ext2 and Ext3 for the first time. For example, you can automatically mount Ext3 using the Ext4 driver.
The next point is the introduction of extents. The thing is that in old versions the file data blocks are displayed in the old way, i.e. all blocks belonging to a certain file are displayed. This imposes some limitations when working with large files. For example, it reduces performance.
Implementing extents allows displaying a large number of consecutive blocks of information with a single descriptor. Such an approach increases file system performance by several times. The system stores only the address of the first and last data block, which corresponds to a large file.
Reducing file fragmentation by allocating memory blocks more efficiently is one more innovation. Before writing a file, Ext4 highlights blocks that are nearby in order to reduce the time needed to find the right block while reading the data.
Ext4 has a delayed allocation feature, which allocates memory blocks immediately before writing files to disk. Such a solution allows to reduce the load on the cache memory and therefore increase performance.
New for Ext4 is the ability to create an unlimited number of subdirectories without performance loss. The reason is that Ext4 uses HTree data structure, which is a version of the B-tree adapted specially for Ext4.
An innovation that improves performance and security at the same time is the implementation of journal checksums. This method constantly checks data blocks for corruption. In turn, this reduces journaling time and increases performance.
A quick file system checking is now available. The way it has been implemented is as follows: in Ext4, the inodes tables and free block groups are marked. It means that only blocks with data will be checked during the file system check.
A new feature is e4defrag, which allows you to defragment both the whole disk and individual files. Fragmentation reduction not only makes the system faster but also reduces the load on the processor, etc.
As you can see there are quite a few innovations, and they greatly improve security and performance. In turn, this is exactly what users need. That’s why Ext4 is so popular today.
Advantages and disadvantages of the Ext4 file system
Despite the introduction of new features and performance improvements, the Ext4 file system has a lot of disadvantages as well. Therefore, before you start using it on your disk, we suggest the user compare its advantages and disadvantages.
The advantages of Ext4 include the following:
- Journaling – the file system keeps a change journal, so in case of failures, you can restore the file system structure without any problems;
- Encryption support – users can now encrypt their data without performance degradation;
- High stability – Ext4 file system can control its state by itself. It is done with the help of journal checksums. Also, more than 10 years have passed since the release of Ext4, and during that time it has proved itself as a very reliable file system;
- Supported by default in many distributions – which means that you’ll have all the Ext4 tools you need out of the box. It is also used in memory cards in Android smartphones, which means you will not need to install additional software to work with smartphone data;
- Active development – as of today, developers are actively working on improving Ext4. You will constantly get new opportunities for working with data;
- Low fragmentation – you get a very fast file system. Often lack of fragmentation is the deciding factor when it comes to what file system to use on flash drives and removable media;
- A large number of limits – during the creation of the file system, a certain number of inodes are created which are needed to write the files. In some file systems, the number of inodes may be too small and the user will not be able to write a new file even if there is free space on the disk. It can happen if you have a lot of small files. Fortunately, Ext4 does not have this problem and there are enough inodes for users and server systems alike;
Unfortunately, the disadvantages of Ext4 are also quite a few. Among the most significant are:
- Lack of support for next-generation file system features – Ext4 does not support volume management, data deduplication, etc;
- Lack of checksum verification for data – this makes it impossible to detect data corruption due to hardware failures;
- Poor scalability – despite the fact that the maximum size of a partition is 1 Exabyte, in reality, if you create partitions larger than 100 Terabytes, the performance is very slow;
- Lack of support for transparent compression and transparent encryption – these technologies are still in the experimental stage;
- Inodes take up to 10% of the partition space – if fewer inodes are allocated when the file system is created there is a possibility they will run out and the user will not be able to write new files even if the disk has free space;
Now you can compare the advantages and disadvantages of the Ext4 file system and decide for yourself if you want to use it or not.
The EXT file system structure
The structure of the EXT file system is the same as that of most UNIX file systems. Schematically, it can be shown as follows:
That is, you can distinguish several main components in the EXT structure:
- Superblock – located at the beginning of the file system (usually in the first 1024 bytes of the partition). The system automatically creates several copies of the superblock, as it cannot function without such one. The superblock stores basic information about the file system, such as:
- the total number of data blocks and inodes for the entire file system;
- the number of free inodes and data blocks into which files can be written;
- the size of the inode and data block (these data are specified when the file system is created);
- information about the file system – mounting time, last changes, etc.
- Immediately after superblock, there is a global table of block group descriptors (Group Description Table). This table describes the first and last blocks for each group of blocks, as well as information about wherein each group the inodes table begins, the beginning of data blocks, etc.
- Block Bitmap is a special table that specifies which blocks in a group are used and which are free. This information is used during block information allocation. 0 means block is free and 1 means block is occupied.
- Inode Bitmap – is the same that the block bitmap, but displays information about free inodes, which can be used to write new files.
- Data Blocks – the allocated physical blocks of memory where user data is stored.
The file system structure is roughly the same for Ext2, Ext3, and Ext4. Only the functionality of each version of the EXT file system differs.
Is it worth turning off journaling
The main purpose of journaling is to ensure that the file system structure can be restored in case of failures or sudden power outages. At the same time, the journaling process requires some time and resources. Therefore, some users decide to disable journaling to get more performance.
It is subjective, as disabling Journaling only makes sense if you have advanced data protection features (e.g. if you use RAID 5).
If you have no additional security — don’t disable Journaling as the performance gain is very small, while the risk of losing important data is several times greater.
However, if you decide to disable Journaling, make sure to protect your important data first by backing it up, using a RAID array, or at least using an uninterruptible power supply.
How to open an EXT drive in Windows?
The Windows operating system natively uses the NTFS file system. Therefore, as soon as you plug in a drive formatted in EXT, Ext2, Ext3, Ext4 – you will immediately get a notification that the drive’s file system is unsupported.
The first (and best) way is to use the RS Partition Recovery program. This program is easy to use. All you need is to install it on your computer. Then you can immediately connect the Ext2,3,4 drive and work with the data. You don’t even need to reboot your computer.
But most importantly, RS Partition Recovery allows you to recover lost data if something happens to the file system or with the file itself. For example, you accidentally deleted a file – no problem. You formatted the drive with important information – no big deal. RS Partition Recovery will recover your data.
We would also like to mention the support forALL modern file systems, which makes RS Partition Recovery a kind of universal tool, which should be in the arsenal of everyone who works with data.
The second way is to install the EXT2FSD — driver that adds support for the Ext 2, 3, or 4 file system in Windows.
The main disadvantage of this method is that the EXT2FSD driver sometimes conflicts with the Windows drivers, and instead of the promised EXT support you may get a non-working operating system. Also, attempts to restore Windows functionality may often lead to the loss of important data. Not only on the C:\ drive but also on the external drive (if it was connected to the computer at the time of the failure).
The third way is to install a special plug-in for Total Commander called ext4tc. This method also has pitfalls. Firstly, you will need to buy Total Commander itself and then install ext4tc plugin additionally.
In addition, sometimes after installing the ext4tc plugin, the file manager crashes. Therefore, you should be careful when manipulating important data.
We strongly recommend not to risk important information because sometimes it costs more than the whole computer and programs. That is why it is better to use the first method described above.
The best alternatives to the EXT file system
There is more and more information on the web that since Ext4 does not support next-generation features – the Linux operating system will switch to Btrfs soon. That is why many users wonder if it is worth using Ext4 or if it is better to install an alternative file system like Btrfs or a different one.
The decision is up to the user, but really — Ext4 does not support a lot of today’s features. So if you want to use a time-proven filesystem but are ready to give up a lot of modern features, your choice is Ext4. It is stable, widely supported, and works fine.
If you want to have a modern filesystem that will support all the new features, and at the same time not be afraid to deal with a somewhat less mature ecosystem, Btrfs is your choice. Also, you’ll be one step ahead, since most Linux distributions will be using it by default shortly.
If you are looking for the best file system for your server and you are looking for reliability and minimal risk of data loss, the best alternative is the ZFS file system. There is one thing — you have to read a lot of information and learn a lot of commands to use it as efficiently as possible.
Using or not the EXT file system is up to everyone. We hope that after reading this article — you will be able to make the choice that best suits your needs.