Ext (Extended File System) is one of the main components of the Linux operating system and is fast and highly secure. Although Ext is currently replaced with Ext4, it is the most used system in Linux distributions.
Linux Ext File Systems
Ext (Extended File System)
Ext is the first system created for the Linux kernel and has the structure of the Unix operating system. Rémy Card was designed in April 1992 due to the limitations of the MINIX system.
Ext was the first in the extended systems series and was used by both Ext2 and Xiafs in 1993. Ext2 became popular and used for a long time because it solved fundamental problems such as inode and fragmentation that occurred in Ext’s first series.
Ext2 (Second Extended File System)
Ext2 is the Second Extended system designed by Rémy Card as an extensible system for Linux, the most successful system in the Linux community and the basis for all existing Linux distributions.
Ext2 uses the strategy of saving the data contained in files into data blocks.
All of these data blocks are the same length, and although this length varies between different Ext2 systems, the size of the blocks for a given Ext2 is determined when created using mke2fs.
The size of each file is rounded to the number of integer blocks. If the block size is 1024 bytes, a 1025-byte file will contain two 1024-byte blocks.
Not all file system blocks contain data. Some should be used to protect information that describes the structure of the file system.
It defines the file system topology by defining each one as having an inode data structure.
An inode describes which blocks occupy a file’s data, as well as the file’s access permissions, the time of file modification, and the type of file.
A unique inode identifies each file on the system, and each inode has a unique number that identifies it. File system nodes are stored together in inode tables.
Ext2 directories are particular files that contain pointers to the nodes of your directory entries.
Ext2 Data Structures
The space in Ext2 is divided into blocks, and the blocks are similarly organized into groups of cylinder groups in the Unix file system.
This is done to reduce external fragmentation and minimize the number of disk searches when reading a large number of consecutive data.
Each block contains a superblock group, bitmap blocks group, and inode bitmap followed by actual data blocks.
The superblock contains essential information that is important for booting the operating system, so copies are created in each group block of each block in the file system.
However, only the first copy used in the first block of the file system is used initially.
The identifier group stores the start of the bitmap block, inode bitmap, and inode table for each group block, which is stored in the table identifier group.
Each inode contains the following information:
- Inode number
- File type
- Owner of said file
- File permissions
- Same establishment date
File System Limits
Some limits on the Ext2 file system are due to the data file format and the operating system kernel.
Often, these factors are determined once the file system is created. The 8 KB block size is only possible in the default alpha architecture.
Many programs cannot process files larger than 2 GB.
The directory lower level limit is about 32768. If the number of files in a directory exceeds 10,000 to 15,000 files, the user is usually warned that the operations may take a long time.
The theoretical limit for the number of files in a directory is 1.3 × 1020, but this is not relevant in practical situations.
Ext3 (Third Extended File System)
Ext3 is a third extended file system with logging. It is the most widely used file system in Linux distributions, although Ext4 now replaces it.
The main difference with Ext2 is logging. An Ext3 system can be installed and used as an ext2 system.
Another critical difference is that Ext3 uses a balanced binary tree (AVL tree) and includes the Orlov disk block mapper.
Ext3 partitions do not have a different file structure than Ext2, so it not only switches from Ext2 to Ext3, and vice versa, but is instrumental in some cases if the registry is accidentally corrupted, for example, due to corrupt sectors of the disk.
So, there is full compatibility between Ext2 and Ext3 so that you can convert Ext2 to Ext3 or vice versa. Since the disk format is the same, you can easily configure the Ext3 system as Ext2.
Advantages
Although its speed and scalability are lower than those of its competitors like JFS, ReiserFS, or XFS, it has the advantage of allowing you to upgrade from Ext2 to Ext3 without losing stored data or having to format the disk.
CPU consumption is lower and is considered safer than other Linux file systems due to its relative simplicity and longer test time.
Ext3 adds logging to Ext2, tree directories, and online growth for directories spanning multiple blocks.
Size Limits
Ext3 has two different size limits, one for the files and one for the size of the entire file system, and the size limit is 231−1 blocks.
Journaling Levels
Journal (Low Risk)
Metadata and content files are copied to the journal before being imported into the primary file system. Since the magazine is always on disk, it can improve performance in certain situations.
At other times, performance is worse because the data should be written twice, once in the journal and once in the central part of the file system.
Ordered (Medium Risk)
Only metadata is recorded in the journal, not the content, but the content of the file is written to disk before the associated metadata is marked as copied in the journal.
It is the default system in most Linux distributions. If there is a voltage drop or Panic core while the file is being written or initialized, it indicates that the journal’s new file or experiment has not been passed, so the cleaning process cleans it.
Writeback (High Risk)
Only metadata is logged, and the content of the files is not recorded. Content can be written before or after updating the journal.
As a result, files that have been successfully changed before a break can be corrupted. For example, the file waiting to be journaled is more extensive than it is now and is sent to the trash at the end of the audit.
Old versions of files may appear unexpectedly after journal recovery. Lack of synchronization between data and journaling is quickly resolved in many cases. JFS uses this level of journaling but ensures that all unnecessary items are cleared at reboot.
Disadvantages
Functionality
Because Ext3 is Ext2 compatible, most archive structures are similar to Ext2. Therefore, Ext3 lacks many features of newer designs, such as extensions, dynamic inode localization, and block sub-location.
For each directory, there are 31998 subdirectory limits derived from 32 connection limits per inode.
Ext3, like most existing Linux file systems, cannot be controlled by fsck while the file system is mounted to write.
Trying to check an installed file system can detect incorrect errors where data has not yet been spilled onto the disk and try to fix these errors and corrupt the file system.
Fragmentation
There is no file-leveling online defragmentation tool for Ext3.
There is an offline defragmenter for E2defrag, but Ext3 must be converted to Ext2 before it starts.
However, depending on the bits opened in the system, e2defrag can destroy the data. There are user tools to combine, like Shake and Defrag.
Shake works by finding the entire file as a process, which often causes the locator to find disk space constantly.
It also tries to write used files at the same time as others. Defrag works by copying each file onto itself. They work only if the file system is empty and there is no accurate defragmentation tool for this generation.
Some file systems, such as ext3, effectively find the nearest empty blocks in the file.
So you don’t have to worry about fragmentation on a Linux system. While Ext3 is more fragmentation resistant, there is nothing that prevents Ext3 systems from breaking over time.
As a result, Ext3 includes Ext4’s successor, a merge utility, and support for extensions of adjacent regions of the file.
Compression
Compression support is available as an unofficial patch for ext3. This patch is a direct e2compr port, but more needs to be developed since logging is not yet implemented.
Control
It does not checksum during journaling. If barrier = 1 is not activated as an assembly option and hardware is corrupt, there is a risk of extensive file system corruption in the event of a sudden hardware failure.
Windows and Ext3
Although Windows does not have native support for Ext2 or Ext3, drivers can be installed to access such file systems. It can be installed on all Windows systems with X86 architecture.
This drive makes it possible to assemble partitions without using separate programs. It shows us the file system as if it were another partition within the windows.
Another option is to use a program to view and copy files in a partition that includes Ext3 and Ext2 but does not mount the partition.
The programs you can use to access the Ext system on your Windows system are as follows;
Ext4 (Fourth Extended File System)
An Ext4 system is fault-tolerant because the integrity of the data is ensured. After all, changes in the metadata of the files are first journaled.
Since Linux 2.6.28, the kernel has officially supported the new Ext4 system.
The Ext4 release date is 2008. Ext4 is an enhanced version of Ext2 and Ext3, and some important data structures have been changed. In addition, only registry functionality was added to this.
Ext4 can provide better performance and reliability as well as richer features.
By applying a few commands, you can switch from Ext2 and Ext3 to Ext4 without having to format the disk or reboot the system. Ext4 still retains its original data structure and Ext4’s role in new data.
It currently supports 16 TB of the 2 TB maximum file size, while Ext4 supports the 1 EB (1024 TB) file system and 16 TB maximum file size.
It currently only supports 32,000 subdirectories. Ext4 supports an unlimited number of subdirectories.
When writing data to the Ext3 file system, the block mapper can allocate only a 4 Kb block whenever it maps; writing a 100 Mb file calls the burst mapper 25,600 times. It also uses an MBALLOC (Multi-Block Mapper) to map multiple blocks of data.
Delay Distribution
It uses the block allocation data strategy to allocate as soon as possible.
Ext4 and other modern file strategies delay cache allocation as much as possible until the file that starts in the distribution of blocks ends and writes to disk.
So, you can optimize the first two features of data blocks, which can significantly improve the entire file distribution and performance.
Quick Disk Control
Fsck will be very slow first because it has to check the entire file index. Ext4 adds an unused inode list to each group’s inode table.
Verification Record
Part of the registry is the most common, but it also easily causes hardware disk failure, and getting rid of registry data damage causes more data corruption.
The Ext4 recording function can easily verify data logging to determine whether the Damage and Ext3 two-stage system will be recorded in a single stage to increase performance while improving performance.
Closing the Registry
The registry can always be overloaded. Ext4 allows you to close the registry so that some users with special needs can improve performance.
Online Merge
Despite the delay in deployment, assigning multiple categories and classes can reduce file system fragmentation, but fragmentation inevitably results.
Ext4 defragmentation is supported online and provides the e4defrag tool for individual files or entire defragmentation.
Inode Features
Ext4 supports the largest inode. It has also been edited to accommodate extended inode attributes better. Ext4 also supports the rapid expansion of features and inode stock.
Internal Cache
It is equipped with a built-in cache to disk to rewrite data to adjust the amounts to optimize performance, so the file system must be written to disk after logging data to write a confirmation journal. If registry confirmation is written first, the registry may be corrupted, and data integrity may be affected.
Ext4 is enabled by the barrier by default, but when all the data is the barrier before writing to disk, the data can be written after the barrier.