---
title: Filesystems
description: Description and recommendations for the available filesystems. (ext4, f2fs, btrfs, xfs, zfs)
---

CachyOS offers 5 different filesystems to allow the user to choose what best fits their needs. The following will go over advantages, disadvantages, and recommendations for each filesystem. Each filesystem comes with its requirements/utilities preinstalled on CachyOS.

:::note
BTRFS is the default and recommended filesystem for CachyOS. Choose it if unsure.
:::

## XFS

XFS is a journaling filesystem created and developed by Silicon Graphics, Inc. It was created in 1993, ported to linux in 2001, and is now widely supported by most Linux distributions.

### Pros

- XFS was originally designed with speed and extreme scalability in mind.
- Reliable, XFS makes use of several technologies to prevent data corruption.
- Resistant to fragmentation due to its extent-based nature and delayed allocation strategy.

### Cons

- Cannot be shrunk.

### Userspace utility

The package containing userspace tools to manage XFS filesystems is `xfsprogs`.

### Recommendation

XFS is the recommended filesystem for users who do not need advanced features and simply want a fast and reliable filesystem.

## BTRFS

BTRFS is a modern copy-on-write(COW) filesystem created in 2007 and declared stable in the linux kernel in 2013. It is widely supported and is mainly known for its advanced feature set.

### Pros

- Transparent compression. BTRFS supports transparently compressing files to allow for significant space savings with no user intervention. **CachyOS ships with ZSTD compression set to level 3 by default.**
- Snapshot functionality. BTRFS leverages its COW nature to allow for the creation of snapshots of subvolumes that take up very little actual space.
- Subvolume functionality allowing for greater control over the filesystem.
- Able to grow or shrink.
- Very fast development.

### Cons

- Sometimes requires defragmentation or balancing.
- Worse on rotational drives due to aforementioned fragmentation.

### Userspace utility

Btrfs userspace utility package is `btrfs-progs`

### Subvolume Layout

CachyOS provides a subvolume layout out of the box to allow easy snapshot functionality.

- Subvol @ = /
- Subvol @home = /home
- Subvol @root = /root
- Subvol @srv = /srv
- Subvol @cache = /var/cache
- Subvol @tmp = /var/tmp
- Subvol @log = /var/log

### Recommendation

BTRFS is recommended for users who want snapshot/backup functionality and transparent compression.

## EXT4

EXT4 (fourth extended filesystem) is the most commonly used Linux filesystem. EXT4 was made stable in the linux kernel in 2008.

### Pros

- Can be as fast or faster than XFS in some scenarios.
- Very common, allowing easy access to plenty of resources.
- Reliable. EXT4 has a proven track record of being very reliable.
- Able to grow or shrink.
  - Shrinking is only supported offline and requires the filesystem to be unmounted.

### Cons

- Lacks many of the advanced features other filesystems offer.

### Userspace utilities

The package to manage ext4 is `e2fsprogs`

### Recommendation

EXT4 is recommended for users who want the simplest and most commonly used filesystem.

## ZFS

ZFS is an advanced filesystem originally developed by Sun Microsystems in 2005. ZFS has many features, but is licensed under CDDL which means it cannot be included inside the linux kernel and requires a separate module installed.

:::caution
Do not use a Real-time kernel together with ZFS, it's not compatible due to licensing issues.
:::

### Pros

- Pooled storage (zpool)
- Snapshots using COW
- Compression
- Raid-Z support
- ARC cache allows insanely fast read times on commonly accessed files.

### Cons

- Very complicated to use and understand due to features like zpool and ARC.
- ARC requires a lot of ram to be effective.
- Not included in the linux kernel therefore dependent on a third party kernel module (OpenZFS)
- Incompatible with Real-time preemption

### Required tools

'ZFS-Module' CachyOS provides a precompiled zfs module for each kernel version.
`zfs-utils` for the userspace utilities.

### Recommendation

ZFS should only be used by advanced users who want to use its advanced features, such as pooled storage or the ARC cache.

## F2FS

F2FS (Flash-Friendly File System) is a flash file system originally created and developed by Samsung for the linux kernel. F2FS was created to cater specifically for the NAND flash used in modern day storage.

### Pros

- Designed with flash friendliness in mind.
- Transparent compression used to reduce disk writes (space savings not currently usable by the user).
- Better wear leveling, which further prolongs the life of NAND flash.

### Cons

- Cannot shrink.
- Space savings from compression cannot currently be used by the user. This may be added in the future.
- Relatively weak fsck (filesystem check).
- Downgrading to a kernel older than the version that created the filesystem may cause issues.
- Requires a workaround when used with GRUB on MBR/BIOS system.

### Userspace utilities

The main utility for f2fs is `f2fs-tools`

### Recommendation

- F2FS is recommended for users who want to maximize the lifespan of their NAND flash devices.
- Limine is the recommended bootloader for F2FS users on MBR/BIOS systems since it does not require a workaround like GRUB does.

## TL:DR

Use the default filesystem **BTRFS** as it is considered stable and has a lot of neat features (snapshots, compression, etc). Use **XFS** or **EXT4** for a simple
and fast filesystem.
