| BCACHEFS(8) | System Manager's Manual (smm) | BCACHEFS(8) |
NAME
bcachefs — manage
bcachefs filesystems/devices
SYNOPSIS
bcachefs |
command [options] [arguments] |
DESCRIPTION
The bcachefs utility supports the
following subcommands, which are documented in detail below:
Superblock commands
format- Format one or a list of devices with bcachefs data structures.
show-super- Dump superblock information to stdout.
Mount commands
mount- Mount a filesystem.
Repair commands
fsck- Check an existing filesystem for errors.
Commands for managing a running filesystem
fs usage- Show disk usage
Commands for managing devices within a running filesystem
device add- Add a new device to an existing filesystem
device remove- Remove a device from an existing filesystem
device online- Re-add an existing member to a filesystem
device offline- Take a device offline, without removing it
device evacuate- Migrate data off of a specific device
device set-state- Mark a device as failed
device resize- Resize filesystem on a device
Commands for managing filesystem data
data rereplicate- Rereplicate degraded data
Commands for encryption
unlock- Unlock an encrypted filesystem prior to running/mounting
set-passphrase- Change passphrase on an existing (unmounted) filesystem
remove-passphrase- Remove passphrase on an existing (unmounted) filesystem
Commands for migration
migrate- Migrate an existing filesystem to bcachefs, in place
migrate-superblock- Add default superblock, after bcachefs migrate
Commands for debugging
Miscellaneous commands
version- Display the version of the invoked bcachefs tool
Superblock commands
bcachefsformat[options] devices ...- Format one or a list of devices with bcachefs data structures. You need to
do this before you create a volume.
Device specific options must come before corresponding devices, e.g.
bcachefs format --label=ssd /dev/sda --label=hdd /dev/sdb-b,--block=size- block size, in bytes (e.g. 4k)
--btree_node=size- Btree node size, default 256k
--metadata_checksum_type=(none|crc32c|crc64)- Set metadata checksum type (default:
crc32c). --data_checksum_type=(none|crc32c|crc64)- Set data checksum type (default:
crc32c). --compression=(none|lz4|gzip|zstd)- Set compression type (default:
none). --data_replicas=number- Number of data replicas
--metadata_replicas=number- Number of metadata replicas
--replicas=number- Sets both data and metadata replicas
--encrypted- Enable whole filesystem encryption (chacha20/poly1305); passphrase will be prompted for.
--no_passphrase- Don't encrypt master encryption key
--error_action=(continue|remount-ro|panic)- Action to take on filesystem error (default:
remount-ro) -L,--label=label- Create the filesystem with the specified label
-U,--uuid=uuid- Create the filesystem with the specified uuid
-f,--force- Force the filesystem to be created, even if the device already contains a filesystem.
Device specific options:
bcachefsshow-super[options] device- Dump superblock information to stdout.
Mount commands
bcachefsmount[options] device mountpoint- Mount a filesystem. The device can be a device, a
colon-separated list of devices, or UUID=<UUID>. The
mountpoint is the path where the filesystem should
be mounted. If not set, then the filesystem won't actually be mounted but
all steps preceeding mounting the filesystem (e.g. asking for passphrase)
will still be performed.
-ooptions- Mount options provided as a comma-separated list. See userguide for
complete list.
degraded- Allow mounting with data degraded
verbose- Extra debugging info during mount/recovery
fsck- Run fsck during mount
fix_errors- Fix errors without asking during fsck
read_only- Mount in read only mode
version_upgrade
-k,--key-location=(fail|wait|ask)- Where the password would be loaded from. (default:
ask). -v- Be verbose. Can be specified more than once.
Repair commands
Commands for managing a running filesystem
bcachefsfsusage[options] [filesystem]- Show disk usage.
-h- Print human readable sizes.
Commands for managing devices within a running filesystem
bcachefsdeviceadd[options] device- Add a device to an existing filesystem.
bcachefsdeviceremove[options] device- Remove a device from a filesystem
-f,--force- Force removal, even if some data couldn't be migrated
--force-metadata- Force removal, even if some metadata couldn't be migrated
bcachefsdeviceonlinedevice- Re-add a device to a running filesystem
bcachefsdeviceofflinedevice- Take a device offline, without removing it
-f,--force- Force, if data redundancy will be degraded
bcachefsdeviceevacuatedevice- Move data off of a given device
bcachefsdeviceset-state[options] new-state device-
- new-state=(rw | ro | failed | spare)
-f,--force- Force, if data redundancy will be degraded
bcachefsdeviceresizedevice [size]- Resize filesystem on a device
Commands for managing filesystem data
bcachefsdevicerereplicatefilesystem- Walks existing data in a filesystem, writing additional copies of any degraded data.
Commands for encryption
bcachefsunlockdevice- Unlock an encrypted filesystem prior to running/mounting.
bcachefsset-passphrasedevices ...- Change passphrase on an existing (unmounted) filesystem.
bcachefsremove-passphrasedevices ...- Remove passphrase on an existing (unmounted) filesystem.
Commands for migration
bcachefsmigrate[options] device- Migrate an existing filesystem to bcachefs
-ffs- Root of filesystem to migrate
--encrypted- Enable whole filesystem encryption (chacha20/poly1305)
--no_passphrase- Don't encrypt master encryption key
-F- Force, even if metadata file already exists
bcachefsmigrate-superblock[options] device- Create default superblock after migrating
Commands for debugging
These commands work on offline, unmounted filesystems.
bcachefsdump[options] device- Dump filesystem metadata
bcachefslist[options] devices ...- List filesystem metadata to stdout
Miscellaneous commands
bcachefsversion- Display the version of the invoked bcachefs tool
EXIT STATUS
The bcachefs utility exits 0 on
success, and >0 if an error occurs.
| March 7, 2023 | Debian |