$linuxjunkies
>

btrfs(8)

Manage Btrfs filesystems, volumes, and subvolumes with administrative and monitoring tools.

UbuntuDebianFedoraArch

Synopsis

btrfs <subcommand> [<subcommand_args>]

Description

Btrfs (B-tree filesystem) is a modern copy-on-write filesystem for Linux with advanced features like snapshots, subvolumes, and RAID support. The btrfs command provides a suite of administrative utilities to create, manage, and monitor Btrfs filesystems.

Common subcommand groups include: filesystem (mount, unmount, show), subvolume (create, delete, list, snapshot), device (add, remove, stats), balance (rebalance data), scrub (check filesystem integrity), and quota (manage disk quotas).

Common options

FlagWhat it does
btrfs filesystem showShow information about all Btrfs filesystems
btrfs filesystem df <mount>Display space usage statistics for a mounted Btrfs filesystem
btrfs subvolume create <path>Create a new subvolume at the specified path
btrfs subvolume delete <path>Delete a subvolume or snapshot
btrfs subvolume list <mount>List all subvolumes in a Btrfs filesystem
btrfs subvolume snapshot <source> <dest>Create a snapshot of a subvolume (read-write by default)
-rCreate read-only snapshot (with snapshot subcommand)
btrfs device add <device> <mount>Add a device to a Btrfs filesystem
btrfs balance start <mount>Start balancing data across devices in a filesystem
btrfs scrub start <mount>Start a scrub to check and repair filesystem data
-v, --verboseEnable verbose output for diagnostic information
--helpShow help for a specific subcommand

Examples

Display all Btrfs filesystems and their device information

btrfs filesystem show

Create a new subvolume named 'mysubvol' in a mounted Btrfs filesystem

btrfs subvolume create /mnt/btrfs/mysubvol

Create a writable snapshot of a subvolume for backup purposes

btrfs subvolume snapshot /mnt/btrfs/mysubvol /mnt/btrfs/mysubvol-backup

Create a read-only snapshot useful for preventing accidental modifications

btrfs subvolume snapshot -r /mnt/btrfs/mysubvol /mnt/btrfs/mysubvol.ro

Show disk space allocation and usage on a Btrfs mount point

btrfs filesystem df /mnt/btrfs

Add a new device to a filesystem and rebalance data across all devices

btrfs device add /dev/sdb /mnt/btrfs && btrfs balance start /mnt/btrfs

Start a scrub operation and check its status

btrfs scrub start /mnt/btrfs && btrfs scrub status /mnt/btrfs

List all subvolumes and snapshots with their IDs and mount paths

btrfs subvolume list /mnt/btrfs

Related commands