cetrafs
ReferenceInformation-oriented

fsck.cetra

Check and repair a cetrafs volume offline: synopsis, the four passes, what -r repairs and refuses, and exit codes.

Synopsis

fsck.cetra [-r] <blockdev>
OptionMeaning
(none)Check only. Changes nothing.
-rRepair faults that have one correct answer. Refuses everything else.

Preconditions

Refuses to run if the volume is mounted locally, or if its Node Registry has a live row (some node has it mounted, or crashed less than a stale window ago).

Passes

PassChecks
1. StructuralSuperblock checksum and region map; Zone Group and Block Group descriptors and headers; Zone Group ↔ Block Group ownership contiguity; Node Registry rows
2. Cluster metadataPer-node journal flags and slots; pending-free queue entries
3. ContentInode bitmap and data bitmaps against the extent trees (all depths), in both directions; cross-file block overlap; cached free counts against bitmaps; leaks
4. NamespaceEvery directory’s entries and block tails; . and ..; link counts against referring entries; directory entry type against inode mode; reachability from the root

What -r repairs

FaultRepair
Bitmap bit disagrees with the extent trees (leaked, or would be double-allocated)Bit set to match the trees
Block Group or Zone Group cached free count disagrees with its bitmapCount recomputed
nlink disagrees with the entries naming the inodenlink corrected
Orphan inode with nlink = 0Freed
Orphan inode with nlink > 0 (lost directory entry)Linked into /lost+found as #<ino>

If -r reports reclaimed blocks, run it again. Some reclamation it enables is picked up on the next pass.

What -r refuses

Reported, never changed:

FaultWhy
Cross-file block overlapNothing on disk says which file should keep the block
Unreadable inode record or extent headerClearing its blocks could hand a live file’s blocks to someone else
Dangling directory entryRemoving it destroys a name

Exit status

CodeMeaning
0Clean
1Problems found
2Bad invocation
3Couldn’t examine the device

Notes

  • Use an fsck.cetra from the same build as the kernel module. A mismatched version can misread the format.
  • After an unclean shutdown, expect a few orphans, counter drift and leaked blocks. See Journaling and crash consistency.

Last updated