-
-
Notifications
You must be signed in to change notification settings - Fork 1
Arch Linux BTRFS Guide
Mattscreative edited this page Dec 5, 2025
·
2 revisions
Complete beginner-friendly guide to Btrfs on Arch Linux, including installation, subvolumes, snapshots, compression, and Btrfs management.
Btrfs is modern filesystem with advanced features.
Features:
- Snapshots
- Compression
- Copy-on-write
- Subvolumes
- RAID support
Create filesystem:
# Format as Btrfs
sudo mkfs.btrfs /dev/sda1
# With label
sudo mkfs.btrfs -L "MyData" /dev/sda1Mount:
# Mount
sudo mount /dev/sda1 /mnt/data
# With compression
sudo mount -o compress=zstd /dev/sda1 /mnt/dataCreate subvolume:
# Create subvolume
sudo btrfs subvolume create /mnt/data/subvol1
# List subvolumes
sudo btrfs subvolume list /mnt/data
# Delete subvolume
sudo btrfs subvolume delete /mnt/data/subvol1Mount subvolume:
# Mount subvolume
sudo mount -o subvol=subvol1 /dev/sda1 /mnt/subvol1Create snapshot:
# Create snapshot
sudo btrfs subvolume snapshot /mnt/data /mnt/data/snapshot-$(date +%Y%m%d)
# List snapshots
sudo btrfs subvolume list /mnt/dataRestore:
# Delete corrupted subvolume
sudo btrfs subvolume delete /mnt/data/corrupted
# Restore from snapshot
sudo btrfs subvolume snapshot /mnt/data/snapshot-20240115 /mnt/data/restoredSet compression:
# Mount with compression
sudo mount -o compress=zstd /dev/sda1 /mnt/data
# Or in fstab
UUID=xxxx-xxxx /mnt/data btrfs defaults,compress=zstd 0 2Compression options:
- zlib: Good compression
- lzo: Fast compression
- zstd: Balanced (recommended)
Check filesystem:
# Check Btrfs
sudo btrfs check /dev/sda1
# Scrub
sudo btrfs scrub start /mnt/dataBalance:
# Balance filesystem
sudo btrfs balance start /mnt/data
# Check usage
sudo btrfs filesystem usage /mnt/dataThis guide covered Btrfs creation, subvolumes, snapshots, compression, and troubleshooting.
- Arch Linux Filesystem Management - Filesystems
- Arch Linux Backup and Restore - Backups
- ArchWiki Btrfs: https://wiki.archlinux.org/title/Btrfs
This guide is based on the ArchWiki. For the most up-to-date information, always refer to the official ArchWiki.