HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

btrfs device — Manage devices in a btrfs filesystem. More information: <https://btrfs.readthedocs.io/en/latest/btrf

Submitted by: @import:tldr-pages··
0
Viewed 0 times
commanddevicesbtrfsbtrfs deviceclimanagefilesystemmore
linux

Problem

How to use the btrfs device command: Manage devices in a btrfs filesystem. More information: <https://btrfs.readthedocs.io/en/latest/btrfs-device.html>.

Solution

btrfs device — Manage devices in a btrfs filesystem. More information: <https://btrfs.readthedocs.io/en/latest/btrfs-device.html>.

Add one or more devices to a btrfs filesystem:
sudo btrfs {{[d|device]}} {{[a|add]}} {{path/to/block_device1 path/to/block_device2 ...}} {{path/to/btrfs_filesystem}}


Remove a device from a btrfs filesystem:
sudo btrfs {{[d|device]}} {{[rem|remove]}} {{path/to/device1|device_id1 path/to/device2|device_id2 ...}}


Display error statistics:
sudo btrfs {{[d|device]}} {{[st|stats]}} {{path/to/btrfs_filesystem}}


Scan all disks and inform the kernel of all detected btrfs filesystems:
sudo btrfs {{[d|device]}} {{[sc|scan]}} {{[-d|--all-devices]}}


Display detailed per-disk allocation statistics:
sudo btrfs {{[d|device]}} {{[u|usage]}} {{path/to/btrfs_filesystem}}

Code Snippets

Add one or more devices to a btrfs filesystem

sudo btrfs {{[d|device]}} {{[a|add]}} {{path/to/block_device1 path/to/block_device2 ...}} {{path/to/btrfs_filesystem}}

Remove a device from a btrfs filesystem

sudo btrfs {{[d|device]}} {{[rem|remove]}} {{path/to/device1|device_id1 path/to/device2|device_id2 ...}}

Display error statistics

sudo btrfs {{[d|device]}} {{[st|stats]}} {{path/to/btrfs_filesystem}}

Scan all disks and inform the kernel of all detected btrfs filesystems

sudo btrfs {{[d|device]}} {{[sc|scan]}} {{[-d|--all-devices]}}

Display detailed per-disk allocation statistics

sudo btrfs {{[d|device]}} {{[u|usage]}} {{path/to/btrfs_filesystem}}

Context

tldr-pages: linux/btrfs device

Revisions (0)

No revisions yet.