From b8463ef0399d2cad4797e587d0a8776732ef1128 Mon Sep 17 00:00:00 2001 From: Alexander Ratajczak Date: Tue, 28 Oct 2025 20:47:58 +0100 Subject: [PATCH] * Added Documentation about how to add Device Labels * Clarified how to remove offline devices * Added data scrub documentation * Added set-fs-option as an alternative for sysfs option * Added casefold_disabled option Documentation, not sure if able to be set other than on mount --- doc/bcachefs-principles-of-operation.tex | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/doc/bcachefs-principles-of-operation.tex b/doc/bcachefs-principles-of-operation.tex index dfa5fa6e..bff4d6bf 100644 --- a/doc/bcachefs-principles-of-operation.tex +++ b/doc/bcachefs-principles-of-operation.tex @@ -530,7 +530,8 @@ filesystem: \item \texttt{bcachefs device add}: Formats and adds a new device to an existing filesystem. \item \texttt{bcachefs device remove}: Permanently removes a device from - an existing filesystem. + an existing filesystem. Offline Devices can be removed via ID found + in Superblock \item \texttt{bcachefs device online}: Connects a device to a running filesystem that was mounted without it (i.e. in degraded mode) \item \texttt{bcachefs device offline}: Disconnects a device from a @@ -540,6 +541,7 @@ filesystem: if necessary. \item \texttt{bcachefs device set-state}: Changes the state of a member device: one of rw (readwrite), ro (readonly), failed, or spare. + Offline Devices can be removed via ID found in Superblock A failed device is considered to have 0 durability, and replicas on that device won't be counted towards the number of replicas @@ -552,6 +554,10 @@ The \texttt{bcachefs device remove}, \texttt{bcachefs device offline} and would leave the filesystem degraded or with data missing. Todo: regularize and improve those options. +\subsubsection{Device labeling} +Devices can be labeled after Formatting by setting \\ +\texttt{/sys/fs/bcachefs//dev-/label} + \subsection{Data management} \subsubsection{Data rereplicate} @@ -571,8 +577,10 @@ a third device added. \subsubsection{Scrub} -To be implemented: a command for reading all data within a filesystem and -ensuring that checksums are valid, fixing bitrot when a valid copy can be found. +The \texttt{bcachefs data scrub} Command takes a mountpoint as first parameter and +validates all data with checksums, fixing bitrot when a valid copy can be found. +Currently does not print affected files in the Terminal, but when a broken File is +found the path is being printed into the Kernel Log. \section{Options} @@ -581,7 +589,8 @@ 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 \texttt{/sys/fs/bcachefs//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. +passed as mount parameters the persistent options are unmodified. Additionally +some of the filesystem wide options can be set via \texttt{bcachefs set-fs-option} \subsection{File and directory options} @@ -731,6 +740,9 @@ recursively. \texttt{discard} \` \textbf{device} \\ \> Enable discard/TRIM support \\ \\ + + \texttt{casefold\_disabled} \` \textbf{mount} \\ + \> Disables the Casefolding Feature \\ \\ \end{tabbing} \subsection{Error actions}