Guide

Comparing Linux file systems: Btrfs and Ext4

Pinterest LinkedIn Tumblr

For a long time I have been interested in the question of file systems. There are many of them, there are favorites. From time to time I come across references, comparisons, conversations, but I myself am floating in the question. So which is better and why, which to choose? … … Here I tried to answer this question. 

Btrfs

A file system that actively uses metadata in its work, which speeds up the process, but if the metadata is lost, the data itself is also lost.

When copying, the data is not recorded in its entirety, only the changed part is subject to recording.

Due to the principle of operation, it is well suited for creating snapshots.

Volume management and data compression are already included in the file system, so no additional software installation is required.

The FS itself was developed in 07 with an eye on modern devices, contains optimizations for working with SSDs, error detection and correction processes, real-time defragmentation and deduplication is supported ( Deduplication is a compression process by removing unused duplicate files ).

The data storage format is already frozen, and this is the basis of the FS, but the codebase is being developed. Periodically, improvements appear in the core itself, various large companies are working on improvement. The Btrfs file system is very interesting and promising. 

Ext4

Perhaps the most famous and frequently encountered file system, which is used by default in most distributions. The most stable, since the development was laid back in the last century, systematic development from Ext> Ext2> Ext3.

It uses journaling in its work, which gives greater reliability for files, but reduces speed. If an error occurs, the FS reverts to the previous version from the log. Thanks to the log, even if the recording fails, the file system remains safe.

Real-time defragmentation has been added to Ext4.

Despite its venerable age, it is still being developed. The developers plan to make FS work with checksums in automatic mode and improve quotas, transfer them to the kernel, this will improve performance.

I got at my disposal various modern mechanisms to improve performance, including working with SSDs, but the structure is outdated.

The journal, which is used in work and is often found in the description, is the principle of operation, in which transactions are written first to the journal, and changes / writes occur after.

Other

In this post, I have not mentioned options such as ZFS, ReiserFS, JFS, and F2FS.

ZFS was originally open source, developed at Sun Microsystems, but then was bought out by Oracle, its code is closed, and a fork of the latest available version was released as OpenZFS. Officially, it is absent in the kernel, because its license conflicts with the GPL, and L. Torvalds opposes. But distribution developers can provide support through the compatibility layer. In a number of parameters, it is similar to Btrfs, which is distributed under a free license and is officially supported in the kernel.

All of them are either no better or worse in some parameters than the above. Such a variety of FS creates the “Problem of choice”; in practice, the differences between them are not noticeable. Therefore, for me the conclusion remained the same: Ext4 for disks – the old recording technology, Btrfs for SSD – more modern devices.

In the comments I will leave a link to a screenshot from the GParted program. It clearly shows that other file systems do not have such wide support from one of the most famous and widespread programs for working with partitions.

Write A Comment

Exit mobile version