home / docs / build-pipeline / mkfs-root

mkfs-root.sh

Finalizing the root as the filesystem you chose.

scripts/mkfs-root.sh is the final stage of the build pipeline. Given your chosen TARGET_FS, it formats and assembles $ROOT so the disk reflects exactly the filesystem you selected at install.

What it does

  • Formats. Creates the filesystem image with the matching mkfs tool (ext4, btrfs, xfs, zfs, f2fs, jfs, reiserfs, swap, or the ext2/ext3 lineage).
  • Populates. Copies the built rootfs into the formatted volume.
  • Wiring. Ensures fstab and boot records match your selections.

Honest flags

The filesystem tooling is built in stage 2 from your choice — if you picked zfs, you get ZFS tools; if reiserfs, you get its (unmaintained) tooling, after a stability warning. Whatever you choose, the tooling and the format match.

The result of stage 3 is a rootfs that will boot — with the exact filesystem, kernel, init, and tools you picked. That's the whole pipeline in one line.

← Build pipeline