bcachefs-device

Manage devices in a bcachefs filesystem

TLDR

Evacuate data from a device before removing it
$ bcachefs device evacuate [path/to/device]
Remove a device from the filesystem permanently
$ bcachefs device remove [path/to/device]
Add and format a new device with a label
$ sudo bcachefs device add --label [group].[name] [path/to/mountpoint] [path/to/device]

SYNOPSIS

bcachefs device command [options] device

DESCRIPTION

bcachefs device manages devices within a running bcachefs filesystem. It allows adding new devices to expand storage, evacuating data before removal, and permanently removing devices.Device labels organize storage into groups (like ssd or hdd) and individual device names, enabling tiered storage configurations.

PARAMETERS

-l, --label label

Assign a disk label to categorize the device (e.g., ssd.cache, hdd.bulk)
--fs_size size
Size of filesystem to use on the device (add)
--bucket size
Set the bucket size (add)
--discard
Enable discards on the device (add)
-f, --force
Force the operation even if data redundancy would be degraded, or use a device that appears already formatted
-F, --force-metadata
Force removal even if some metadata could not be migrated (remove)
--force-if-data-lost
Force a state change even if data will be lost (set-state)
-o, --offline
Operate on an offline device (set-state)

SUBCOMMANDS

add

Add a device to an existing filesystem
remove
Remove a device from a filesystem
online
Re-add a device to a running filesystem
offline
Take a device offline without removing it
evacuate
Move all data off of a given device
set-state new-state device
Set the device state to rw, ro, failed, or spare
resize
Resize the filesystem on a device

INSTALL

sudo dnf install bcachefs-tools
sudo pacman -S bcachefs-tools
sudo apk add bcachefs-tools
nix profile install nixpkgs#bcachefs-tools

CAVEATS

Removing devices may take considerable time depending on data volume. Ensure sufficient free space on remaining devices before evacuating. Device operations require the filesystem to be mounted.

SEE ALSO

bcachefs(8), mkfs(8), fsck(8), mount(8)

RESOURCES

Homepage · Source code