Linux Filesystem Btrfs

btrfsctl — legacy Btrfs control tool

btrfsctl is an older utility used to control Btrfs filesystems. It has largely been replaced by the modern btrfs command suite.

Historical Context

btrfsctl was used in early Btrfs implementations for operations like adding or removing devices. It is now deprecated in favor of:

btrfs filesystem ...
btrfs device ...
btrfs subvolume ...
Modern systems may not include btrfsctl at all. Use the unified btrfs command instead.

10 Historical / Reference Examples

1) Add device to Btrfs filesystem (legacy)

sudo btrfsctl -a /dev/sdb1 /mnt/btrfs

2) Remove device (legacy)

sudo btrfsctl -r /dev/sdb1 /mnt/btrfs

3) Show help

btrfsctl --help

4) Modern equivalent: add device

sudo btrfs device add /dev/sdb1 /mnt/btrfs

5) Modern equivalent: remove device

sudo btrfs device remove /dev/sdb1 /mnt/btrfs

6) List filesystem info

btrfs filesystem show

7) Show mounted Btrfs filesystems

findmnt -t btrfs

8) Create subvolume

sudo btrfs subvolume create /mnt/btrfs/newsub

9) Snapshot subvolume

sudo btrfs subvolume snapshot /mnt/btrfs/sub /mnt/btrfs/sub_snap

10) Balance filesystem

sudo btrfs balance start /mnt/btrfs