1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-08-02 11:35:41 +02:00
tldr/pages/linux/bcachefs.md
Managor bca386f4c5
bcachefs: add runtime replication examples (#13486)
Co-authored-by: spageektti <git@spageektti.cc>
2024-08-20 21:08:51 +02:00

1.1 KiB

bcachefs

Manage bcachefs filesystems/devices. More information: https://bcachefs.org/bcachefs-principles-of-operation.pdf.

  • Format a partition with bcachefs:

sudo bcachefs format {{path/to/partition}}

  • Mount a bcachefs filesystem:

sudo bcachefs mount {{path/to/partition}} {{path/to/mountpoint}}

  • Create a RAID 0 filesystem where an SSD acts as a cache and an HDD acts as a long-term storage:

sudo bcachefs format --label=ssd.ssd1 {{path/to/ssd/partition}} --label=hdd.hdd1 {{path/to/hdd/partition}} --replicas=1 --foreground_target=ssd --promote_target=ssd --background_target=hdd

  • Mount a multidevice filesystem:

sudo bcachefs mount {{path/to/partition1}}:{{path/to/partition2}} {{path/to/mountpoint}}

  • Display disk usage:

bcachefs fs usage --human-readable {{path/to/mountpoint}}

  • Set replicas after formatting and mounting:

sudo bcachefs set-fs-option --metadata_replicas={{2}} --data_replicas={{2}} {{path/to/partition}}

  • Force bcachefs to ensure all files are replicated:

sudo bcachefs data rereplicate {{path/to/mountpoint}}

  • Display help:

bcachefs