August 6 2023

Guide to Filesystems for Linux

Guide to choosing and comparing the most popular filesystems on Linux

Choose Linux Filesystems

The universe of filesystems is vast and complex. If you're just getting started with Linux or thinking about installing a new distribution, one of the most critical decisions is filesystem choice. Its selection is not a task to be underestimated, as it can affect the performance, security and integrity of your data. This post intends to walk you through a detailed overview of the most popular filesystems on Linux, listing pros and cons to help you make an informed choice.

Introduction to Filesystems

The filesystem is one of the cornerstones of any operating system, providing a set of rules and data structures that determine how files are managed, saved, and organized within a storage device, such as a hard drive or SSD. This component not only dictates how data is physically stored on disk, but also affects how it can later be accessed, read, or modified.

The design and functionality of a file system can have a direct impact on the performance of a system, how quickly data can be retrieved, and how critical information is safeguarded. This explains why, when faced with choosing a filesystem, it is essential to consider a number of key factors. For example, the nature of your application or system may require one type of file system rather than another. Similarly, some applications may have stringent security needs that require advanced data protection features, while other scenarios may require extra attention to performance and read/write speed.

In essence, choosing a file system is not a decision to be taken lightly, but requires a careful and thoughtful assessment based on the specific needs of the user or application in question.

In this post we will get to the heart of the topic with what can be defined to all intents and purposes a handbook for choosing the Linux filesystem that will show you how to choose the filesystem on Linux and not only on Linux since a filesystem can be used in other operating systems such as, for example, BSD and derivatives such as FreeBSD, OpenBSD and the like.

Some basic notions about filesystems and definitions.

To navigate the vast universe of filesystems in Linux and to make accurate comparisons between the different options, it is essential to start with a solid understanding of the fundamental terminologies and functionality. Many of the common terminologies encountered when exploring filesystems may seem complex at first, but they are essential to understanding how they work and how they can benefit the user. For example, terms like "journaled filesystem" or "snapshot" are crucial to understanding how a particular filesystem handles data and how it ensures integrity and security. Let's take a deeper look at these two concepts.

Filesystem Journaled (or with Journaling):

  • Definition: Journaling, in the context of filesystems, is a mechanism that keeps track of changes that have not yet been applied to the main filesystem. It works by keeping a "journal" of what operations will be done, before they are actually performed.
  • Operation: When you make a change, such as creating or deleting a file, it is first logged in the journal. Only after the registration has been completed successfully is the operation performed on the root filesystem. If, for some reason (such as a power failure), the system crashes before the operation can be completed, upon reboot, the system can consult the journal to complete the operation or restore the filesystem to its previous state, preventing potential corruptions.
  • Benefits: Journaling greatly increases the resiliency and integrity of the file system. In the event of a malfunction or sudden outage, the risk of data loss or corruption is greatly reduced.

Snapshots:

    • Definition: A snapshot is a "snapshot" representation of the filesystem at a given point in time. It works like a snapshot of the filesystem, allowing users to go back to a previous point in time or recover data from a specific state of the filesystem.
    • Operation: When you create a snapshot, the system records information about the current state of the files, without physically duplicating the data. This means that snapshots are usually quick to create and take up little space. When data changes after a snapshot is created, the system retains old versions of the data, ensuring that the snapshot remains unchanged.
    • Benefits: Snapshots are extremely useful for backup and restore operations. If an error occurs, such as accidentally deleting a file, you can go back to the previous snapshot to recover it. Additionally, snapshots are essential for testing, allowing system administrators to test changes and, if necessary, quickly restore the system to its previous state.

Understanding these concepts is critical when trying to determine which filesystem is best suited for your needs, as each offers varying degrees and methods of data protection and operational flexibility.

EXT4: The Prevailing Standard Filesystem

EXT4 (Fourth Extended Filesystem) represents the fourth generation of the EXT filesystem family, originally developed for Linux. Its predecessor, EXT3, introduced the concept of "journaling", a key feature that EXT4 inherited and improved. EXT4 was officially released in 2008, and has since become the default filesystem for many Linux distributions due to its reliability, stability, and good performance.

Pro:

  • Stable and reliable: Extensively tested. The EXT4 has earned its reputation for reliability through years of heavy use and testing. As the standard filesystem of many distributions, it has benefited from constant feedback and improvements from the community.
  • Good overall performance. While it may not boast the best performance in every single scenario, the EXT4 offers a solid balance of speed, reliability, and features.
  • It supports large file sizes and volumes. Unlike its previous versions, the EXT4 supports single files up to 16 TiB and file systems up to 1 EiB, making it suitable for applications with significant storage needs.
  • Journaling: prevents data loss in the event of a crash. One of the main features inherited from EXT3, journaling, ensures that transactions are complete, reducing the risk of data corruption in the event of a system crash or power outage.

Against:

  • It's not the fastest for all uses. While it offers good overall performance, there are specific scenarios, such as some database workloads or I/O-intensive applications, where other filesystems may perform slightly better.
  • It may lack some advanced features found in other filesystems. While EXT4 is powerful and versatile, filesystems like Btrfs or ZFS can offer more advanced features like snapshotting, deduplication, and storage pooling.

Ideal use:

The EXT4 is ideal for general use in desktop and server environments. It can be used for web hosting, file servers, and many other applications that need a balance between performance and reliability. Thanks to its ability to handle large file sizes and volumes, it is also suitable for large storage applications.

Not Ideal Usage:

For applications that need advanced features such as snapshotting or deduplication, other filesystems such as Btrfs or ZFS may be preferable. Similarly, in I/O-intensive scenarios, such as high-performance databases, EXT4 may not be the optimal choice compared to other more specific options.

In summary, the EXT4 is a workhorse in the world of Linux filesystems, offering a robust combination of performance, scalability and reliability, while having some limitations in specific usage scenarios.

ReiserFS: The Pioneer of Efficiency

ReiserFS, often simply known as Reiser, is a journaled filesystem introduced in 2001 by Hans Reiser, with endorsement from Namesys. It was particularly known for its ability to handle small files efficiently, which made it a popular choice in many Linux distributions in the early 2000s. ReiserFS introduced many innovative features, such as balanced tree and an efficient storage technique for small directories and files. While it has been largely supplanted by other filesystems in modern distributions, it laid the foundation for many concepts now common in journaled filesystems.

Pro:

  • Efficient handling of small files: One of the main features of ReiserFS is its ability to store small files and directories extremely efficiently, reducing wasted space.
  • Performance: Due to its design and journaling system, ReiserFS offered competitive performance, especially in scenarios with many small files.
  • B+ tree: Its implementation of the B+ tree allowed for efficient data organization, further improving performance and efficiency.

Against:

  • Disputes and lack of development: Due to legal and personal issues related to its main developer, Hans Reiser, the development of ReiserFS has slowed down significantly. This has led many to migrate to other filesystems such as EXT4 or Btrfs.
  • Lack of some modern features: Over time and the lack of regular updates, ReiserFS has started to lack some of the advanced features found in more modern filesystems.

Ideal use:

In its prime, ReiserFS was ideal for servers and workstations that had large numbers of small files. Due to its efficient handling of small files, it was often used in web servers, mail servers and databases with many small records.

Not Ideal Usage:

In today's technology landscape, ReiserFS may not be the best choice for new installations due to its lack of development and support. Filesystems like EXT4 or Btrfs offer better maintenance, advanced features, and wider community support.

Bottom line, while ReiserFS made a significant impact in the Linux filesystem world in the early 2000s, external circumstances and the evolving technology landscape have seen its popularity decline. However, his innovative approach to filesystem problems has left a lasting impression.

Btrfs (B-tree FS): The New Frontier

Btrfs, often pronounced "Butter FS" or "Better FS", represents a new era for filesystems on Linux. Born in 2007, Btrfs was developed with the intention of offering advanced features, often compared to those of ZFS, a popular filesystem created by Sun Microsystems. Btrfs was designed to address the shortcomings of traditional filesystems such as EXT4, offering flexibility, scalability and advanced data management capabilities.

Pro:

  • Snapshots: One of the standout features of Btrfs is the ability to quickly create filesystem snapshots. Snapshots allow you to capture and maintain a "snapshot" of the current state of the file system, which is very useful for backups and for rolling back unwanted changes.
  • Data compression: Btrfs supports on-the-fly data compression, which means that data is automatically compressed before being written to disk, saving space and potentially increasing performance.
  • Deduplication: This feature identifies and removes multiple copies of the same data, reducing storage space requirements and improving efficiency.
  • Integrated raid and load balancing: Btrfs offers advanced load balancing features and integrated RAID support, enabling efficient data distribution and providing resilience against disk failure.

Against:

  • Still under development: While Btrfs has been around for several years, it is still considered under development in some respects, which means that new issues or bugs may emerge.
  • Performances may vary: Depending on workload type and configurations, Btrfs performance can vary, making it less predictable than other established filesystems.

Ideal use:

Btrfs is best suited for environments where flexibility, scalability, and advanced data management features are essential. Given its snapshot capability, it is excellent for backup systems and development platforms where fast rollback is critical. The integration of RAID features also makes it suitable for high availability storage environments.

Not Ideal Usage:

Due to its evolving nature and variable performance, Btrfs may not be the best option for critical applications that require maximum stability and predictability. While it offers many advanced features, adoption in mission-critical scenarios may require a thorough risk assessment.

In summary, Btrfs represents a step forward in the world of filesystems, promising a number of features that can revolutionize data management. However, like any new technology, it comes with its challenges and requires careful evaluation before large-scale adoption.

XFS: The High-performance Option

XFS is a high-performance filesystem originally developed by Silicon Graphics, Inc. (SGI) in the 90s for their IRIX operating system. Designed to be extremely scalable in both filesystem size and number of files, XFS was then ported to Linux in the early 2000s. Since then, it has been adopted as a default filesystem option in many Linux distributions , especially for high-performance applications and workloads.

Pro:

  • Great for large files: One of the strengths of XFS is its ability to efficiently handle extremely large file sizes. This makes it particularly suitable for applications such as video editing, scientific simulations or any other task that requires manipulation of large files.
  • High scalability: XFS was designed with scalability in mind. It can support huge filesystem sizes (multi-exabytes) and an almost unlimited number of files.
  • Simple design with a focus on performance: XFS uses a B+ tree data structure for its address tables, allowing for fast access and efficient management operations. Its design is focused on optimizing performance, making it an excellent choice for I/O-intensive applications.

Against:

  • Does not allow volume size reduction: One of the limitations of XFS is the inability to reduce the size of a volume once it has been created. While it can be expanded, shrinking it requires a data backup, format, and restore.
  • Data loss may be greater than for other filesystems in the event of a crash, despite journaling: Although XFS uses journaling to track changes, in certain scenarios, such as sudden power outages, it can result in more data loss than other filesystems.

Ideal use:

XFS shines in environments where high performance and scalability are essential. It is an ideal choice for high-performance database servers, graphics and video editing workstations, and systems that handle large data sets. Its ability to effectively handle large files also makes it great for long-running archive applications.

Not Ideal Usage:

For those who need flexibility in resizing volumes, XFS may not be the best choice due to its inability to reduce volume size. Also, for applications that cannot tolerate data loss, other options with more robust data protection mechanisms may be preferable.

In conclusion, XFS is a powerful option for those looking for performance and scalability. However, like any tool, it is essential to understand its limitations and ensure that it fits your specific application needs.

ZFS: Beyond the Filesystem

ZFS, acronym for Zettabyte File System, is a revolutionary filesystem originally developed by Sun Microsystems for the Solaris operating system in the early 2000s. Designed with the goal of overcoming the limitations of traditional filesystems, ZFS is presented not only as a filesystem , but also as a volume manager. This means that it can handle both file organization and low-level disk operations. In addition to its incredible scalability (hence the name "Zettabyte"), ZFS has pioneered many advanced data management and protection features.

In the context of the continuous evolution and adoption of open source software, OpenZFS was born. This open source variant of ZFS brought the filesystem to a larger community of developers and users, allowing for greater innovation and adaptability. OpenZFS maintains the legacy and functionality of its predecessor, but with the benefit of the transparency, community and collaboration that characterize open source projects.

For those who want to further explore OpenZFS and its history, , promising you can find the official site of the project, while this resource provides specific details on implementing ZFS on Linux.

Pro:

  • Integrated Storage Pools: Unlike other file systems that require a separate volume management solution, ZFS integrates this capability. Users can combine disks into "pools" and ZFS takes care of distributing the data across these pools, making storage management easier and more efficient.
  • Advanced Data Corruption Protection: ZFS is famous for its end-to-end checksumming. Each piece of data (and its checksum) is verified as it is read from disk, ensuring that the data is exactly as it was meant to be when it was written. In case of discrepancies, ZFS can self-correct if a valid copy of the data is available.
  • Excellent management of hardware resources: ZFS uses features such as adaptive caching (ARC) to maximize performance using available RAM. At the same time, it efficiently manages disk I/O and takes full advantage of the power of modern storage drives.

Against:

  • It is not natively included in the Linux kernel due to licensing issues: Due to licensing incompatibilities between the ZFS CDDL license and the Linux kernel GPL, ZFS is not included directly in the Linux kernel. This has led to additional installation and configuration needs to use ZFS on Linux.
  • High memory consumption: ZFS is known for its high RAM consumption, especially its caching functions. While this can improve performance, it can also put pressure on systems with limited hardware resources.

Ideal use:

ZFS is ideal for environments that require extremely high reliability and data protection, such as enterprise storage servers, long-lived archives, and high-capacity database servers. Its integrated volume management and data protection approach make it perfect for those who want a set-and-forget system that takes care of itself.

Not Ideal Usage:

For systems with limited RAM resources or those looking for an out-of-the-box solution without the need for additional configuration, ZFS may not be the ideal option. Also, if native compatibility with the Linux kernel is a priority, other filesystems may be preferable due to the licensing issues associated with ZFS.

Bottom line, ZFS offers an unprecedented feature set in the filesystem world. Its combination of scalability, data protection, and integrated management make it an excellent choice for many scenarios, but as always, it's essential to evaluate your specific needs before adopting it.

F2FS (Flash-Friendly File System): The Optimized for SSD

F2FS is a file system developed by Samsung Electronics specifically for devices with NAND flash memory, such as solid state drives (SSDs) and memory cards. First released in 2012, F2FS was created to address the quirks and challenges of writing and erasing blocks in flash-based devices. Unlike traditional hard disk drives (HDDs) that write data sequentially, SSDs have specific wear and performance patterns that can benefit from a different data management approach.

Pro:

  • Specifically designed for NAND flash memory: F2FS takes into account the unique characteristics of flash memory, such as cell wear and overwrite inefficiency. As a result, it organizes data in a way that maximizes SSD performance and life.
  • High performance on SSD: Thanks to its optimized design, F2FS offers fast response times and high performance, making it an ideal choice for SSDs.
  • Improve SSD life: SSDs have a limited number of write/erase cycles per cell before they start to fail. F2FS reduces unnecessary writes and balances wear across the entire device, extending its life.

Against:

  • Not ideal for traditional hard disk drives (HDD): While F2FS is optimized for SSDs, it was not designed with the characteristics of traditional hard drives in mind. As a result, on HDD it may not offer the same performance as other filesystems.
  • Still evolving; may not be as stable as EXT4 or XFS: Being a newer filesystem and still in development, there may be bugs or problems that have not yet been discovered or fixed. This may make it less suitable for mission-critical applications than more mature filesystems.

Ideal use:

F2FS is ideal for flash-based devices, such as SSDs in laptops and desktops, mobile devices, memory cards, and USB solid-state drives. It is particularly suitable for applications that require high read/write performance and want to maximize the lifespan of their SSD.

Not Ideal Usage:

For traditional hard drive based systems, F2FS may not offer the desired benefits and there are other more suitable options such as EXT4 or XFS. Also, for environments that require extreme and proven stability, such as production servers or mission-critical applications, it may be prudent to wait for F2FS to reach greater maturity or consider more established filesystems.

In conclusion, F2FS represents a significant step forward in optimizing file systems for flash technology. While it has its ideal application niches, it is important to evaluate your specific needs before adopting it.

Benchmarks and speed.

 

When it comes to filesystems, one of the critical aspects to consider is performance. The speed with which a filesystem can read, write, or look up data can vary greatly based on its structure and internal mechanics. In a direct comparison between EXT4, Btrfs, ZFS, XFS, F2FS and ReiserFS, we see marked differences:

  • EXT4 it is often seen as a benchmark in the Linux world due to its stability and good overall performance. It is a versatile filesystem, offering a balance between speed and reliability, especially in environments where stability is crucial.
  • Btrfs it brings with it a number of advanced features, such as snapshots and deduplication. However, these features can sometimes affect overall performance. While in certain scenarios, such as frequent writes and erases, Btrfs may outperform EXT4, in others it may be slower due to its complexity.
  • ZFS is known for its excellent management of hardware resources and its ability to protect against data corruption. However, it has a high memory consumption, which can affect performance in resource-constrained systems.
  • XFS stands out when it comes to handling large files. It is optimized for intensive workloads and often outperforms other filesystems in scenarios such as video editing or handling large databases.
  • F2FS it is optimized for SSDs and as a result, offers surprisingly high performance in such environments. Its ability to improve the lifespan of SSDs is an added bonus, but on traditional hard drives it may not offer the same performance.
  • ReiserFS, while older, had gained a reputation for its efficient handling of small files. However, in comparison to modern filesystems, it may not hold a candle in terms of overall performance.

Conclusion: How to Choose the Right Filesystem?

Navigating through the vast array of filesystems available in the Linux world may initially seem like a journey through a technological maze. Many ask the question, "With so many options, how do I know which one is best for me?" Well, the answer to that question lies in a deep understanding of your specific needs and carefully analyzing the peculiarities of each filesystem.

First, it is essential to define what the priorities are. If what you seek is a balance of stability and reliability, coming from years of development and testing, the EXT4 emerges as a solid stronghold. On the flip side, if you're an experimenter at heart and are drawn to cutting-edge features, both Btrfs and ZFS can offer a treasure trove of innovations, though they also come with their own share of challenges.

For those who often find themselves handling very large files or exponentially growing datasets, XFS shines like a beacon, thanks to its optimization for such workloads. And speaking of the future, we cannot ignore the unstoppable advance of SSDs in the world of computing. In this context, F2FS presents itself as an innovator, offering solutions optimized specifically for these devices.

However, beyond all these considerations, it is imperative to remember a fundamental truth: the true strength of a file system lies in its ability to respond to user needs while ensuring high performance, impenetrable security and irrefutable data integrity. So, as you explore your options, always keep these three pillars at the heart of your decision-making process.

 

Do you have doubts? Don't know where to start? Contact us!

We have all the answers to your questions to help you make the right choice.

Chat with us

Chat directly with our presales support.

0256569681

Contact us by phone during office hours 9:30 - 19:30

Contact us online

Open a request directly in the contact area.

INFORMATION

Managed Server Srl is a leading Italian player in providing advanced GNU/Linux system solutions oriented towards high performance. With a low-cost and predictable subscription model, we ensure that our customers have access to advanced technologies in hosting, dedicated servers and cloud services. In addition to this, we offer systems consultancy on Linux systems and specialized maintenance in DBMS, IT Security, Cloud and much more. We stand out for our expertise in hosting leading Open Source CMS such as WordPress, WooCommerce, Drupal, Prestashop, Joomla, OpenCart and Magento, supported by a high-level support and consultancy service suitable for Public Administration, SMEs and any size.

Red Hat, Inc. owns the rights to Red Hat®, RHEL®, RedHat Linux®, and CentOS®; AlmaLinux™ is a trademark of AlmaLinux OS Foundation; Rocky Linux® is a registered trademark of the Rocky Linux Foundation; SUSE® is a registered trademark of SUSE LLC; Canonical Ltd. owns the rights to Ubuntu®; Software in the Public Interest, Inc. holds the rights to Debian®; Linus Torvalds owns the rights to Linux®; FreeBSD® is a registered trademark of The FreeBSD Foundation; NetBSD® is a registered trademark of The NetBSD Foundation; OpenBSD® is a registered trademark of Theo de Raadt. Oracle Corporation owns the rights to Oracle®, MySQL®, and MyRocks®; Percona® is a registered trademark of Percona LLC; MariaDB® is a registered trademark of MariaDB Corporation Ab; REDIS® is a registered trademark of Redis Labs Ltd. F5 Networks, Inc. owns the rights to NGINX® and NGINX Plus®; Varnish® is a registered trademark of Varnish Software AB. Adobe Inc. holds the rights to Magento®; PrestaShop® is a registered trademark of PrestaShop SA; OpenCart® is a registered trademark of OpenCart Limited. Automattic Inc. owns the rights to WordPress®, WooCommerce®, and JetPack®; Open Source Matters, Inc. owns the rights to Joomla®; Dries Buytaert holds the rights to Drupal®. Amazon Web Services, Inc. holds the rights to AWS®; Google LLC holds the rights to Google Cloud™ and Chrome™; Facebook, Inc. owns the rights to Facebook®; Microsoft Corporation holds the rights to Microsoft®, Azure®, and Internet Explorer®; Mozilla Foundation owns the rights to Firefox®. Apache® is a registered trademark of The Apache Software Foundation; PHP® is a registered trademark of the PHP Group. CloudFlare® is a registered trademark of Cloudflare, Inc.; NETSCOUT® is a registered trademark of NETSCOUT Systems Inc.; ElasticSearch®, LogStash®, and Kibana® are registered trademarks of Elastic NV This site is not affiliated, sponsored, or otherwise associated with any of the entities mentioned above and does not represent any of these entities in any way. All rights to the brands and product names mentioned are the property of their respective copyright holders. Any other trademarks mentioned belong to their registrants. MANAGED SERVER® is a registered trademark at European level by MANAGED SERVER SRL Via Enzo Ferrari, 9 62012 Civitanova Marche (MC) Italy.

Back to top