Options
Most bcachefs options can be set filesystem wide, and a significant
subset can also be set on inodes (files and directories), overriding the
global defaults. Filesystem wide options may be set when formatting,
when mounting, or at runtime via /sys/fs/bcachefs/<uuid>/options/
.
When set at runtime via sysfs the persistent options in the superblock
are updated as well; when options are passed as mount parameters the
persistent options are unmodified.
File and directory options
<say something here about how attrs must be set via bcachefs attr command>
Options set on inodes (files and directories) are automatically inherited by their descendants, and inodes also record whether a given option was explicitly set or inherited from their parent. When renaming a directory would cause inherited attributes to change we fail the rename with -EXDEV, causing userspace to do the rename file by file so that inherited attributes stay consistent.
Inode options are available as extended attributes. The options that
have been explicitly set are available under the bcachefs
namespace,
and the effective options (explicitly set and inherited options) are
available under the bcachefs_effective
namespace. Examples of
listing options with the getfattr command:
$ getfattr -d -m '^bcachefs\.' filename $ getfattr -d -m '^bcachefs_effective\.' filename
Options may be set via the extended attribute interface, but it is
preferable to use the bcachefs setattr
command as it will correctly
propagate options recursively.
Full option list
block_size
formatFilesystem block size (default 4k)
btree_node_size
formaterrors
format,mount,rutimemetadata_replicas
format,mount,runtimedata_replicas
format,mount,runtime,inodereplicas
formatmetadata_checksum
format,mount,runtimedata_checksum
format,mount,runtime,inodecompression
format,mount,runtime,inodebackground_compression
format,mount,runtime,inodestr_hash
format,mount,runtime,inodemetadata_target
format,mount,runtime,inodeforeground_target
format,mount,runtime,inodebackground_target
format,mount,runtime,inodepromote_target
format,mount,runtime,inodeerasure_code
format,mount,runtime,inodeinodes_32bit
format,mount,runtimeshard_inode_numbers
format,mount,runtimewide_macs
format,mount,runtimeinline_data
format,mount,runtimejournal_flush_delay
format,mount,runtimejournal_flush_disabled
format,mount,runtimeDisables journal flush on sync/fsync. journal_flush_delay
remains
in effect, thus with the default setting not more than 1 second of
work will be lost.
journal_reclaim_delay
format,mount,runtimeacl
format,mountusrquota
format,mountgrpquota
format,mountprjquota
format,mountdegraded
mountvery_degraded
mountverbose
mountfsck
mountfix_errors
mountratelimit_errors
mountread_only
mountnochanges
mountnorecovery
mountnoexcl
mountversion_upgrade
mountdiscard
deviceError actions
The errors
option is used for inconsistencies that indicate some
sort of a bug. Valid error actions are:
continue
Log the error but continue normal operation
ro
Emergency read only, immediately halting any changes to the filesystem on disk
panic
Immediately halt the entire machine, printing a backtrace on the system console
Checksum types
Valid checksum types are:
none
crc32c
(default)
crc64
Compression types
Valid compression types are:
none
(default)
lz4
gzip
zstd
String hash types
Valid hash types for string hash tables are:
crc32c
crc64
siphash
(default)