LinuxCommandLibrary

btrfs-device

Manage devices in a btrfs filesystem

TLDR

Add devices

$ sudo btrfs device add /dev/sdb /dev/sdc path/to/filesystem
copy
Remove devices
$ sudo btrfs device remove /dev/sdb path/to/filesystem
copy
Show error statistics
$ sudo btrfs device stats path/to/filesystem
copy
Scan all disks
$ sudo btrfs device scan --all-devices
copy
Show usage per device
$ sudo btrfs device usage path/to/filesystem
copy

SYNOPSIS

btrfs device command [OPTIONS] [device|path]

DESCRIPTION

btrfs device manages devices in a btrfs filesystem. It can add or remove devices, display statistics, and scan for btrfs filesystems. This enables dynamic resizing and RAID configuration changes.

PARAMETERS

add

Add one or more devices to the filesystem
remove
Remove a device from the filesystem
delete
Alias for remove
stats
Show device error statistics
scan
Scan devices for btrfs filesystems
usage
Show detailed per-device allocation statistics
ready
Check if a device is ready
-d, --all-devices
Scan all devices for btrfs filesystems

CAVEATS

Removing a device requires enough space on remaining devices to hold relocated data. The filesystem must be mounted to add or remove devices. Adding devices does not automatically balance data.

HISTORY

btrfs device is part of the btrfs-progs package for managing btrfs filesystems on Linux.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community