Scroll to navigation

BCACHEFS(8) System Manager's Manual (smm) BCACHEFS(8)

NAME

bcachefsmanage 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 one or a list of devices with bcachefs data structures.
Dump superblock information to stdout.

Repair commands

Check an existing filesystem for errors.

Startup/shutdown, assembly of multi device filesystems

Assemble an existing multi device filesystem
Incrementally assemble an existing multi device filesystem
Start a partially assembled filesystem.
Stop a running filesystem.

Commands for managing a running filesystem

Show disk usage

Commands for managing devices within a running filesystem

Add a new device to an existing filesystem
Remove a device from an existing filesystem
Re-add an existing member to a filesystem
Take a device offline, without removing it
Migrate data off of a specific device
Mark a device as failed
Resize filesystem on a device

Commands for managing filesystem data

Rereplicate degraded data

Commands for encryption

Unlock an encrypted filesystem prior to running/mounting
Change passphrase on an existing (unmounted) filesystem
Remove passphrase on an existing (unmounted) filesystem

Commands for migration

Migrate an existing filesystem to bcachefs, in place
Add default superblock, after bcachefs migrate

Commands for debugging

Dump filesystem metadata to a qcow2 image
List filesystem metadata in textual form

Miscellaneous commands

Display the version of the invoked bcachefs tool

Superblock commands

bcachefs format [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
, --block=size
block size, in bytes (e.g. 4k)
=size
Btree node size, default 256k
=(none | | )
Set metadata checksum type (default: crc32c).
=(none | | )
Set data checksum type (default: crc32c).
=(none | | | )
Set compression type (default: none).
=number
Number of data replicas
=number
Number of metadata replicas
=number
Sets both data and metadata replicas
Enable whole filesystem encryption (chacha20/poly1305); passphrase will be prompted for.
Don't encrypt master encryption key
=(continue | | )
Action to take on filesystem error (default: remount-ro)
, --label=label
Create the filesystem with the specified label
, --uuid=uuid
Create the filesystem with the specified uuid
, --force
Force the filesystem to be created, even if the device already contains a filesystem.

Device specific options:

=size
Create the filesystem using size bytes on the subsequent device.
=size
Specifies the bucket size; must be greater than the btree node size
Enable discards on subsequent devices
, --quiet
Only print errors
bcachefs show-super [options] device
Dump superblock information to stdout.
, --fields=fields
List of sections to print
, --layout
Print superblock layout

Repair commands

bcachefs fsck [options] devices ...
Check an existing filesystem for errors.
Automatic repair (no questions)
Don't repair, only check for errors
Assume "yes" to all questions
Force checking even if filesystem is marked clean
Be verbose

Startup/shutdown, assembly of multi device filesystems

bcachefs assemble devices ...
Assemble an existing multi device filesystem.
bcachefs incremental device
Incrementally assemble an existing multi device filesystem.
bcachefs run
Start a partially assembled filesystem.
bcachefs stop filesystem
Stop a running filesystem.

Commands for managing a running filesystem

bcachefs fs usage [options] [filesystem]
Show disk usage.
Print human readable sizes.

Commands for managing devices within a running filesystem

bcachefs device add [options] device
Add a device to an existing filesystem.
=size
Size of filesystem on device
=size
Set bucket size
Enable discards
, --force
Use device even if it appears to already be formatted
bcachefs device remove [options] device
Remove a device from a filesystem
, --force
Force removal, even if some data couldn't be migrated
Force removal, even if some metadata couldn't be migrated
bcachefs device online device
Re-add a device to a running filesystem
bcachefs device offline device
Take a device offline, without removing it
, --force
Force, if data redundancy will be degraded
bcachefs device evacuate device
Move data off of a given device
bcachefs device set-state [options] new-state device
new-state=(rw | ro | failed | spare)
 
, --force
Force, if data redundancy will be degraded
bcachefs device resize device [size]
Resize filesystem on a device

Commands for managing filesystem data

bcachefs device rereplicate filesystem
Walks existing data in a filesystem, writing additional copies of any degraded data.

Commands for encryption

bcachefs unlock device
Unlock an encrypted filesystem prior to running/mounting.
bcachefs set-passphrase devices ...
Change passphrase on an existing (unmounted) filesystem.
bcachefs remove-passphrase devices ...
Remove passphrase on an existing (unmounted) filesystem.

Commands for migration

bcachefs migrate [options] device
Migrate an existing filesystem to bcachefs
fs
Root of filesystem to migrate
Enable whole filesystem encryption (chacha20/poly1305)
Don't encrypt master encryption key
Force, even if metadata file already exists
bcachefs migrate-superblock [options] device
Create default superblock after migrating
device
Device to create superblock for
offset
Offset of existing superblock

Commands for debugging

These commands work on offline, unmounted filesystems.

bcachefs dump [options] device
Dump filesystem metadata
output
Required flag: Output qcow2 image(s)
Force; overwrite when needed
bcachefs list [options] devices ...
List filesystem metadata to stdout
(extents | | | )
Btree to list from
inode:offset
Start position to list from
inode:offset
End position
inode
List keys for a given inode number
(keys | )
 
Force fsck
Verbose mode List mode

Miscellaneous commands

bcachefs version
Display the version of the invoked bcachefs tool

EXIT STATUS

The bcachefs utility exits 0 on success, and >0 if an error occurs.

May 26, 2018 Debian