btrfs(8)
Manage Btrfs filesystems, volumes, and subvolumes with administrative and monitoring tools.
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
| Flag | What it does |
|---|---|
btrfs filesystem show | Show 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) |
-r | Create 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, --verbose | Enable verbose output for diagnostic information |
--help | Show help for a specific subcommand |
Examples
Display all Btrfs filesystems and their device information
btrfs filesystem showCreate a new subvolume named 'mysubvol' in a mounted Btrfs filesystem
btrfs subvolume create /mnt/btrfs/mysubvolCreate a writable snapshot of a subvolume for backup purposes
btrfs subvolume snapshot /mnt/btrfs/mysubvol /mnt/btrfs/mysubvol-backupCreate a read-only snapshot useful for preventing accidental modifications
btrfs subvolume snapshot -r /mnt/btrfs/mysubvol /mnt/btrfs/mysubvol.roShow disk space allocation and usage on a Btrfs mount point
btrfs filesystem df /mnt/btrfsAdd a new device to a filesystem and rebalance data across all devices
btrfs device add /dev/sdb /mnt/btrfs && btrfs balance start /mnt/btrfsStart a scrub operation and check its status
btrfs scrub start /mnt/btrfs && btrfs scrub status /mnt/btrfsList all subvolumes and snapshots with their IDs and mount paths
btrfs subvolume list /mnt/btrfs