Linux File Systems In 2020: Pros, Cons, Pitfalls

As you know, before installing any Linux operating system, you need to format your hard drive and choose the most preferred file system. Here, in 2020, EXT4 is the favorite, and it seems to be the best option possible, but let’s consider the alternatives before we blindly abandon them?

EXT4

“Fourth Extended Filesystem”, which literally translates as “Fourth Extended Filesystem” is fully backward compatible with EXT2 and EXT3 and is considered the standard for most Linux distributions, remaining as popular as its predecessors.

This is one of the safest and most stable options to date, as it supports logging, preventing (as much as possible) data loss after a system crash or power loss.

Two of EXT4’s most powerful features are so-called “extents “and” deferred allocation”, which intelligently manage how data is written to the media to improve performance and reduce fragmentation.

BtrFS

The “b-tree file system” was originally developed by Oracle and continues to grow in popularity, so many consider it the true successor to the EXT dynasty.

Btrfs comes with advanced features such as automatic defragmentation and transparent compression. It follows the copy – on-write principle, preserving new iterations of data and metadata instead of affecting existing ones (“shadow copying”). It also allows you to take snapshots of various file system states, and easily replicate, migrate, and increment backups. Online and offline file system checks further reduce the likelihood of data loss.

Separately, it is worth noting that BtrFS is very SSD-friendly, since it automatically disables its functions, which are useful for mechanical hard drives, but can wear out SSDs.

XFS

XFS was created by Silicon Graphics almost three decades ago for their graphics workstations specializing in 3D graphics rendering.

This is why XFS remains one of the best options for systems that are constantly reading and writing data. Thanks to the use of “allocation groups” – parts of the file system that contain their own index descriptors and free space – it is possible to read and write data in parallel by several threads at the same time. Support for deferred allocation, dynamically allocated inodes, and advanced read-ahead algorithms helps achieve superior performance, especially in large storage pools of up to hundreds of terabytes.

However, its logging support is limited, especially when compared to more modern alternatives, and it may be more prone to data loss. It also scales poorly for more typical everyday and mostly single-threaded scenarios, such as when deleting multiple photos from the Images folder. In other words, this is a story about setting up your own data center, and not an ordinary home machine.

F2FS

One of the (relatively) newer file systems, the “Flash-Friendly File System”, as the name suggests, is one of the best options for use with flash-based storage.

Originally created for this purpose by Samsung, F2FS splits the media into smaller parts, which in turn divides into even smaller parts, which in turn divides, you know. And then it tries to use a lot of these zones instead of reusing the same ones. Combined with TRIM / FITRIM support, this makes it more convenient for flash drives with a limited number of write operations.

There is no point in delving into the capabilities of F2FS, because when it comes to using it with regular media, it is an absolutely ordinary mediocrity that does not stand out either in terms of speed or security, and any other file system will offer you a better set of features. Although, it is worth noting that the discussion takes a completely different turn when it comes to flash storage, for which it was developed.

OpenZFS/ZFS

OpenZFS is a branch of the Zettabyte file system (ZFS) that originally appeared in Sun’s Solaris. Until 2010, ZFS could be used on Linux mainly through FUSE due to licensing issues. After 2010, the development of the open source version began, and by 2016 Ubuntu had enabled its support by default. Since then, when people refer to “ZFS”, they usually mean this branch, instead of Solaris ZFS – which also continues to develop, but goes on a parallel path.

ZFS differs from all alternatives in that it combines a file system with a volume manager. For this reason, it manages not only files and directories, but also the physical media on which they reside. This allows each storage device to be assigned to a pool, which is treated as a single resource. If you’re running out of space, you can add new storage to this pool to expand it, letting ZFS take care of the details.

ZFS also follows the copy-on-write principle, so-called copy-on-write, where instead of changing existing data, it only saves the changes (“deltas”) between the old and new versions. This provides transparent, intelligent storage of multiple copies of data without taking up much space, which can work as backups or snapshots. The user can roll back to the previous states of the file system, undo the changes, or vice versa: transfer all changes to clones of existing data.

These are some of the features that help virtually eliminate any possibility of data loss – at least in theory.

JFS

IBM’s journaled file system was one of the first file systems to support journaling, which reduced the likelihood of data loss. It uses extents, like many other modern alternatives, as well as placement groups, such as XFS, in order to provide high read / write performance.

Without giving preference to any one function, it is great for different tasks at different loads.

Unfortunately, this also means that it is not excellent in any of them. In addition, there are some problems that negatively affect the users ‘ assessment when choosing a file system for their storage. For example, it may delay updating its log indefinitely, increasing the chance of data loss and almost negating the fact that it is a logging file system. Better parallel writes, which are most useful for servers and large databases, but perform worse than EXT4 in more popular desktop usage scenarios.

These are probably the reasons why it is not as popular as other file systems, which are either faster or better at protecting data from loss.

What should you use?

There is a reason why EXT4 is the default choice for most Linux distributions. It is tested, tested, stable, works perfectly and is widely supported. If you are looking for stability, EXT4 is the best Linux file system for you.

If you are not afraid to deal with a somewhat less mature ecosystem, you should also consider BtrFS.

For use on a server where you want to completely eliminate any possibility of data loss, where stability is a middle name, you should try ZFS. However, to be able to use it to the fullest, you will have to go into reading with your head.

For flash media, F2FS is the best option, it’s not even discussed.

Whatever file system you choose, don’t forget to wipe your hard drive completely beforehand if you want to make its existing content virtually unrecoverable.

Don’t forget to use the comments to give your valuable feedback on file systems and the article in general.



Source: omgubuntu.ru

(Visited 21 times, 1 visits today)

Leave a Reply

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