btrfs
Manage Btrfs filesystems
TLDR
Create subvolume
List subvolumes
Show space usage information
Enable quota
Show quota
SYNOPSIS
btrfs [subcommand] [options] [args]
PARAMETERS
check
Check filesystem integrity and repair issues
filesystem
Manage filesystem: df, resize, defrag, sync, usage
subvolume
Create, delete, list, snapshot subvolumes
device
Add, remove, delete, scan devices
balance
Balance data/metadata across devices
scrub
Scrub filesystem for data errors
property
Show or change properties like compression
qgroup
Manage quota groups
send
Send subvolume data stream for backups
receive
Receive subvolume stream
rescue
Superblock, chunk-tree recovery
-v, --verbose
Increase output verbosity (repeatable)
-q, --quiet
Suppress non-error messages
--help
Show help for command or subcommand
--version
Display version information
DESCRIPTION
Btrfs (B-Tree File System) is a modern, copy-on-write filesystem for Linux, featuring snapshots, subvolumes, built-in RAID, compression, quotas, and data integrity checks via checksums. The btrfs command-line tool manages Btrfs filesystems and their components. It supports operations on mounted or unmounted filesystems, including creating/deleting subvolumes and snapshots for efficient backups, adding/removing devices in multi-device setups, balancing data across devices, scrubbing for errors, defragmentation, quota management, and integrity checks.
Designed for scalability and reliability, Btrfs addresses limitations of traditional filesystems like ext4 by providing atomic updates, transparent compression (zlib, lzo, zstd), deduplication, and send/receive for incremental transfers. It's widely used in servers, NAS, and desktops, though some advanced features require careful configuration.
The command uses subcommands for specific tasks, with global options for verbosity and quiet modes. Always unmount filesystems before major operations like checks unless specified otherwise.
CAVEATS
Btrfs RAID5/6 modes are unstable and unsupported for production; backup data before balance/scrub; avoid mixing SSD/HDD without profiles; kernel versions matter for stability.
KEY FEATURES
Snapshots/subvolumes: O(1) creation; RAID 0/1/10 stable, 5/6 experimental; Compression: lzo/zstd; Dedup via reflinks.
MOUNT OPTIONS
Use compress=zstd, space_cache=v2, ssd for optimization; degraded for missing devices.
HISTORY
Initiated by Chris Mason at Oracle in 2007; merged into Linux kernel 2.6.29 (2009). Evolved with features like quotas (2012), compression (2013), RAID56 (2014, unstable). Now mature in kernel 6.x, used in Fedora, openSUSE.
SEE ALSO
mkfs.btrfs(8), btrfsck(8), btrfstune(8), mount(8)


