What to consider when choosing a file system for Linux

Drivers for the main file systems are included in the kernel. This means that unless the developers have purposely removed them, any distro should recognize the major Linux file systems without issue. However, not all systems are designed for the same.

Of course, the most common that we can find, for general use (that is, to install a distro, for example), is EXT. Specifically version 4. However, if we are advanced users and want to optimize the drives as much as possible, we are still interested in betting on a more complete file system, such as BtrFS. Or, if we want to squeeze the most out of an SSD, we can choose to use F2FS, a system designed specifically for solid units. Or, if we are going to mount a RAID, we must use a file system specially designed for this type of configuration.

Of course, it must be borne in mind that not all file systems serve the same purpose. For example, a distro (like Ubuntu) may not be able to boot from some filesystems, and the bootloader itself may not load due to using a full filesystem.

In order to choose the best file system, next, we are going to see which are the most important, how they differ and what is their ideal use.

Major file systems

The main file systems that we can use in Linux are:

EXT4 (next to EXT2 and EXT3)

Extended4, Fourth Extended Filesystem, or better known as EXT4, is the file system used by most distributions. Roughly, becomes the NTFS of Linux. This file system came to succeed EXT3, including a host of functions and features, including support for solid SSDs.

Among its characteristics we can highlight better performance and reliability of data than its predecessor, support for journaling and security measures to prevent data loss in the event of a power outage. In addition, extended and delayed allocation features improve performance and reduce drive fragmentation.

Advantage:

  • It is the most used file system.
  • It has SSD support and features like TRIM.
  • Possibility of deactivating journaling to protect the read and write cycles of the SSDs.

Drawbacks

  • It uses an old technology as it is an update of EXT, EXT2 and EXT3.
  • Journaling is enabled by default.

As it is included in the kernel, we do not need any additional configuration to be able to use it.

XFS

This file system was originally created for specialized 3D rendering workstations. However, despite being three decades old, XFS it is one of the most loyal users’ favorite file systems.

This format is specially designed for systems that do a lot of reads and writes of data on the disks. It offers outstanding performance even in situations of maximum workload, and has data validation systems to avoid losing the information stored in the drives. In addition, thanks to its advanced functions, such as dynamically assigned inodes and advanced algorithms, and storage groups that allow us to join units to add their space, it achieves more than excellent performance, performance that improves the larger the unit. .

Advantage:

  • Great performance in very large units or groups of units.
  • Optimized to work with SSD drives. TRIM and defragmentation functions for them.

Disadvantages:

  • It has journaling, and it cannot be disabled.
  • It is more complex to configure, not suitable for new users.

It is also included in the kernel and does not need configuration, although it can be difficult to install a distro in XFS as it is not a recommended option by default.

F2FS

This file system was originally created for work with NAND-based drives, such as USB sticks or, above all, SSD drives. This file system was designed by Samsung, although it has earned the trust of the community due to its excellent performance. When we format a drive with it, the space is divided into very small parts so that, instead of reusing the same sector over and over again, the data is stored in different parts, extending the useful life of the drives. In addition, it has support for specific SSD technologies, such as TRIM or FITRIM.

Read:  With a Day of the Dead spot, Doritos wins over the LGBT community; this is the reason

Advantage:

  • Specially designed to be used in SSD.
  • Modern and new, compatible with the latest technology.

Disadvantages:

  • It does not stand out at all. Neither in performance, nor in speed nor in data security.
  • Not recommended for mechanical units.

Although there are some distros that support it, it is not a system that is available on all distros.

BtrFS

Acronym for «b-tree file system«, BtrFS was designed by Oracle with the intention of succeeding EXT. However, it has not yet succeeded. This file system has a host of advanced features that improve the overall performance of all types of drives, such as advanced defragmentation and data compression. In addition, it allows you to activate shadow copies of the data in a way that improves the persistence and security of these. It even has support for snapshots, being able to replicate data, migrate it to other units or create incremental backups in a very simple and efficient way.

It is RAID compatible, although it is not particularly heavy for itespecially for complex setups. Also, many users use it on their SSDs because, although it supports journaling, it disables it by default on these drives. Also support TRIM and advanced defragmentation functions.

Advantage:

  • Optimized for SSD. It does not activate journaling by default, and it has TRIM and more functions.
  • A new, modern and constantly developing system.
  • Function to defragment native and secure SSD.

Disadvantages:

  • It is not specially designed for RAID.
  • Something unstable, and if it crashes we can lose the data.
  • Some of its features could end up damaging SSDs.

This file system is supported in most of the distributions that we can install today, and even some, such as OpenSUSE, use it by default to install the OS.

OpenZFS

OpenZFS is a fork of Zettabyte File System (ZFS), developed by Sun. After many licensing problems, finally, in 2010, the development of this new file system began. And, since 2016, many distros, such as Ubuntu, support it as standard.

OpenZFS is a file system specially designed to work in RAID systems. In addition to being compatible with all RAID configurations, this file system stands out for also supporting RAIDZ, a configuration that improves redundancy and reduces data loss in the event of an unexpected power outage.

Advantage:

  • Optimized for RAID.
  • Loss of data in case of almost non-existent power outage.

Disadvantages:

  • Not recommended for users without knowledge, and when a RAID is not going to be configured.
  • RAIDZ consumes a large amount of resources.

Which is the best?

As we can see, each file system has its own advantages and disadvantages. If we want to play it safe, then we must bet on EXT4. This file system is the one that most distros recommend us to use by default and offers us the stability and performance we want without complications.

If you are looking to make the most of an SSD drive, and maximize its useful life, then the file system to choose is BtrFS.

Finally, in servers (for example, in a NAS) where we are going to configure a RAID of disks, if we want to make the most of it and have the least possible problems, then we must format with ZFS or OpenZFS, then mounting the units in RAIDZ, now which is your best choice.