Ext4 Vs Btrfs: Which Linux File System To Use?

To be honest, few people think about what file system to use for their computers.

Windows and macOS users have no particular reason to search, as they only have one choice for their system – NTFS and HFS+, respectively. Linux, on the other hand, has many different file systems, the default is Fourth Extended Filesystem (ext4). Have you wanted to change it to B-Tree (Btrfs) for a long time? Let’s figure out what’s best.

What do file systems do?

Image Credit: Maksym Kaharlytskyi/Unsplash

Like physical file systems, such as folders and cabinets, digital file systems manage files. They control how your operating system stores data that is not used, what other information (known as metadata) is attached to the data, who or what has access to the data, and so on.

File systems run in the background. Like the rest of the operating system core, they are mostly invisible in everyday use. File managers, the applications you use to manage files, basically work the same way, no matter what file system is running underneath them.

File systems are incredibly complex to program. Developers are constantly revising these systems to include more functionality and at the same time make them more efficient.

Why switch file systems?

No single code is suitable for all use cases, this also applies to file systems. Some file systems allocate for various reasons. The File Allocation Table (FAT) file system is supported by almost all modern operating systems.

USB flash drives and SD cards use a FAT system, so your computer can read them regardless of whether you are running Linux, Windows, macOS, or another operating system.

But these days, FAT is not as reliable and powerful as some of the other file systems that have been developed since then. So while you’re using FAT, you won’t see how it manages the data on your hard drive.

Current Linux file System

Most versions of desktop Linux distributions use the ext4 file system by default. It became an improved version of the ext3 file system, which had previously been improved over the ext2 file system.

ext4 has proven to be a very reliable file system, but it is outdated. Some Linux users are looking for features that ext4 can’t handle on its own. There is software that solves some of these problems, but being able to perform these actions at the file system level would provide better performance. Hence the desire of users for Btrfs.

Understanding ext4: Pros and cons

Ext4’s limitations remain quite impressive. The largest volume/partition that can be created with ext4 is 1 exbibyte, which is equivalent to approximately 1,152,921. 5 terabytes. The maximum file size is 16 tebibytes, or approximately 17.6 terabytes, which is much larger than any hard drive that a typical user can buy at the moment.

It is known that ext4 provides an increase in speed compared to ext3 due to the use of several different technologies. Like most modern file systems, ext4 is journalable, which means it keeps a ” log ” of where files are on the disk, and of any other changes on the disk.

Despite all its features, it does not support transparent compression, transparent encryption, or data deduplication. Technically, snapshots are supported, but this feature is experimental.

Theodore Ts’o, a developer who played a key role in the creation of ext4, called it a release based on outdated technology from the 1970s and believed that Btrfs would offer better development. That was more than a decade ago.

Understanding Btrfs: Pros and Cons

Btrfs, which can be pronounced “Butter FS”, “Better FS”, or “B-Tree FS”, is a newer file system redesigned from scratch. Btrfs exists because the developers wanted to extend the functionality of the file system to include additional functionality such as pooling, snapshots, and checksums.

The project started at Oracle, but since then other large companies have been involved in the development. The list includes Facebook, Netgear, Red Hat, and SUSE.

While the improvements found in btrfs may benefit general users, some of the additional features are of greater interest for enterprise use. This functionality is designed for more demanding use cases, which often require longer-lasting hard drives.

For organizations that use very large databases, having a seemingly continuous file system on multiple hard drives can make data consolidation much easier. Data deduplication will reduce the amount of actual space occupied by the data, and data mirroring will become easier when there is a single, extensive file system that needs to be mirrored.

Of course, you can still create multiple partitions to avoid mirroring everything. The maximum size of a btrfs file system partition is 16 exbibytes, the same as the maximum file size.

Given that btrfs will be able to span multiple hard drives, it’s good that it supports 16 times more disk space than ext4.

Have Linux distributions made the transition?

Btrfs has been a stable part of the Linux kernel since 2013, and you can reformat your hard drives today. But btrfs is not the default Linux file system. Most distributions continue to use ext4 by default.

Why? Files are the most important data on your hard drive. Personal data is irreplaceable. You can reinstall the OS and restart the apps, but without a backup, the lost files will be gone forever. This is why it is very important that the file system is tested for reliability before switching millions of people to use it by default.

Ext4 may be old and possibly fragile, but it has already proven its resilience and reliability. If the power goes out and the computer goes out, there is a good chance that ext4 will save your data.

For most people, such situations are the most important factor. It’s not about how well the file system works when things go well, it’s about what happens when things go bad.

One well-known distribution determined that enough time had passed to switch. openSUSE now uses btrfs by default for the /root partition where the operating system resides. However, for the /home partition where your personal files are stored, openSUSE decided to use the XFS file system instead.

So no, the transition didn’t go quite as expected. But as we know, new technologies sometimes take a long time to spread throughout the Linux environment.

Source: omgubuntu.ru

(Visited 6 times, 1 visits today)

Leave a Reply

Your email address will not be published. Required fields are marked *