cetrafs
ReferenceInformation-oriented

mkfs.cetra

Create a cetrafs volume: synopsis, every option with its default and bounds, auto-tuning, and exit codes.

Synopsis

mkfs.cetra <blockdev> [-z ZGs] [-b BG_MiB] [-N inodes] [-J MiB] [-M nodes] [-n] [-f]

The device must be the first argument. Options follow it.

Options

OptionMeaningDefaultBounds
-z ZGsNumber of Zone Groups161–255; clamped down to the actual number of Block Groups
-b BG_MiBBlock Group size in MiB1024; automatically 512 on small devices≥ 512
-N inodesTotal inodes1 per 4 MiB of device, capped at 65,536≥ 1024; must fit a 32-bit count
-J MiBJournal size per node, in MiB2; shrunk so the total across all node slots stays near 5% of the device0 disables journaling; otherwise at least 12 KiB per node
-M nodesNode Registry capacity (maximum cluster nodes)641–64
-nDry run: compute and print the geometry, write nothing
-fForce: overwrite a device that looks non-empty. Never overrides a live peer.

Auto-tuning

When -b and -J are omitted:

  • Block Group size drops from 1024 MiB to 512 MiB when 1024 MiB would lose more than about 10% of the device to rounding. There is no partial Block Group at the end of the device.
  • Journal size is capped so that all -M per-node journals together take about 5% of the device.

Both have no effect on normal-sized LUNs, and passing -b or -J explicitly overrides them.

What it writes

The superblock, the Zone Group table, the Block Group table, the global inode bitmap and inode table, an empty Node Registry, the pending-free queues, the per-node journal areas, every Block Group header and bitmap, and the root directory (inode 1). Every structure gets its checksum. Block Groups are distributed evenly across Zone Groups: each Zone Group gets B / Z of them, and the first B mod Z Zone Groups get one extra.

Output

A summary on stdout, beginning cetrafs mkfs completed (or cetrafs mkfs (DRY-RUN) with -n), listing the device size, Zone Group and Block Group counts and sizes, the location and size of each region, how Block Groups were divided among Zone Groups, and the superblock checksum.

Exit status

CodeMeaning
0Volume created (or dry run completed)
1Couldn’t create: device too small (under 1024 blocks), non-empty without -f, impossible geometry, or a write failure
2Bad invocation, or an argument out of range
3Device couldn’t be accessed, or is mounted locally or by a live peer

Examples

mkfs.cetra /dev/sdb -n          # preview
mkfs.cetra /dev/sdb             # defaults
mkfs.cetra /dev/sdb -M 8 -z 32  # 8 nodes, 32 Zone Groups
mkfs.cetra /dev/sdb -f          # reformat a device that held data

Last updated