../fs

Linux File Systems Overview ๐Ÿ’พ

Original URL: https://trevorsmale.github.io/techblog/post/fs/

1. ext4 ๐Ÿ’พ (Linux, BSD)

Intro

ext4 (Extended File System version 4) is the default file system for many Linux distributions.

https://en.wikipedia.org/wiki/Ext4 https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/6/html/storage_administration_guide/ch-ext4#ch-ext4

Technical Features: ๐Ÿ”

Advantages ๐Ÿ‘

Downsides ๐Ÿ‘Ž

Scale

Distro Usage

2. XFS ๐Ÿ’พ (Linux, BSD)

Intro

XFS is a high-performance file system designed for parallel I/O operations, often used in enterprise environments.

https://en.wikipedia.org/wiki/XFS https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/7/html/storage_administration_guide/ch-xfs

Technical Features: ๐Ÿ”

Advantages ๐Ÿ‘

Downsides ๐Ÿ‘Ž

Technical Details ๐Ÿ”

Distro Usage

XFS has been in the Linux Kernel since 2001 It is the default file system for RHEL

3. Btrfs ๐Ÿ’พ (Linux)

Intro

Btrfs (B-tree File System) is a modern, copy-on-write file system designed for Linux that offers advanced features like snapshots, RAID support, self-healing, and efficient storage management, making it suitable for scalable and reliable data storage.

https://en.wikipedia.org/wiki/Btrfs https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/6/html/storage_administration_guide/ch-btrfs https://docs.kernel.org/filesystems/btrfs.html

Technical Features: ๐Ÿ”

Advantages ๐Ÿ‘

Downsides ๐Ÿ‘Ž

Technical Details ๐Ÿ”

Distro Usage

Btrfs has been in the mainline linux Kernel since 2008 it is the default file system for SUSE and Fedora

4. OpenZFS ๐Ÿ’พ (Unix)

Intro

OpenZFS is an advanced file system and volume manager that originated from Sun Microsystemsโ€™ ZFS and is now maintained by the OpenZFS project.

https://en.wikipedia.org/wiki/OpenZFS https://openzfs.org/wiki/Main_Page

Technical Features: ๐Ÿ”

Advantages ๐Ÿ‘

Downsides ๐Ÿ‘Ž

Technical Details ๐Ÿ”

Distro Usage

Open ZFS is Not available in the mainline Linux Kernel. Rather, it is available through a 3rd party module. Works on Linux, BSD, and Mac

HAMMER2 ๐Ÿ’พ (DragonflyBSD)

Intro

Hammer2 is a modern, advanced file system designed for high-performance and scalable storage solutions, particularly in clustered environments. It features robust capabilities such as copy-on-write, data deduplication, and built-in snapshots, providing high data integrity, efficient storage management, and instant crash recovery.

Wikipedia: HAMMER2 DragonFly BSD Hammer2

Technical Features: ๐Ÿ”

Advantages ๐Ÿ‘

Downsides ๐Ÿ‘Ž

Technical Details ๐Ÿ”

Distro Usage

Key Concepts / Glossary ๐Ÿ”‘

Snapshots ๐Ÿ“ธ

Clones vs. Snapshots ๐Ÿ“ธ๐Ÿงฌ

RAID-Z Levels โ›“๏ธ

RAID 5 and RAID 6 โ›“๏ธ

Issues with RAID 5/6 in Btrfs

Btrfsโ€™s implementation of RAID 5/6 is considered unstable due to issues like the write hole problem, making it less reliable for production use. Data integrity may be compromised, leading to potential data loss.

CDDL License ๐Ÿชช

The Common Development and Distribution License (CDDL) is an open-source license created by Sun Microsystems. It is incompatible with the GPL, which can complicate integration with Linux.

Btrfs Self-Healing โค๏ธโ€๐Ÿฉน

Self-Healing in Btrfs works by verifying data against checksums and repairing any detected corruption using redundant data stored on other disks in a RAID configuration.

Dynamic Storage ๐Ÿงฑ

Dynamic Storage refers to the ability to manage multiple storage devices within a single file system, allowing for on-the-fly addition and removal of devices, with the file system automatically balancing data across them.

Online Resizing ๐Ÿ—บ๏ธ

Online Resizing allows the resizing of a file system while it is mounted and in use. XFS supports growing the file system online, while Btrfs supports both growing and shrinking.

B-Trees โš–๏ธ

A B-tree is a self-balancing tree data structure that maintains sorted data and allows efficient insertion, deletion, and search operations. B-trees are used in file systems like Btrfs to manage metadata and data blocks.

Extent Base Allocation ๐Ÿ‘ 

is a method used by modern file systems to manage data storage efficiently. Instead of tracking individual fixed-size blocks, the file system groups contiguous blocks into larger units called extents.

Persistent Pre-allocation ๐ŸŽŸ๏ธ

This technique reserves a specific amount of disk space for a file in advance, ensuring that the allocated space remains available, which helps in reducing fragmentation and guaranteeing storage for large files.

Delayed Allocation โฑ๏ธ

Delayed allocation defers the assignment of specific disk blocks to file data until the data is flushed to disk, optimizing the allocation process and reducing fragmentation by allowing the file system to make better decisions about where to place data.

Multi-block Allocation โ‹”

Multi-block allocation allows a file system to allocate multiple contiguous blocks at once, rather than individually, improving performance and reducing fragmentation, especially for large files.

Stripe-aware Allocation ๐Ÿง 

Stripe-aware allocation is used in RAID configurations to ensure that data is distributed evenly across all disks in the array, optimizing performance by aligning data placement with the underlying stripe size of the RAID setup.

Fine-Grained Locking (for SMP Scalability) ๐Ÿš€

Fine-grained locking applies locks at a granular level, allowing multiple processors to concurrently access different parts of the file system, enhancing performance and scalability in multi-core environments.

RAID 1+0 ๐Ÿ–‡๏ธ

RAID support includes configurations such as RAID 1 for data mirroring and RAID 1+0 for combining mirroring with striping to provide both redundancy and improved performance.

Thin Provisioning ๐Ÿ”ฎ

Thin provisioning allocates disk space on-demand rather than reserving it all upfront, optimizing storage utilization by only using the space actually required by data.

Asynchronous Bulk-Freeing ๐Ÿ—‘๏ธ

Asynchronous bulk-freeing performs large-scale space reclamation in the background, allowing the file system to manage deletions efficiently without impacting overall performance.

Large Directory Support ๐Ÿข

Large directory support enables efficient management of directories with a vast number of entries, using optimized data structures to ensure fast performance for directory operations.