MKFS.NILFS2(8)

✨ MKFS.NILFS2 ✨

okay bestie, welcome to the mkfs.nilfs2(8) page β€” it's a System Manager's Manual situation, section 8, and it's literally all about making NILFS2 filesystems. let's get into it πŸ’–


🌸 NAME 🌸

mkfs.nilfs2 β€” create a NILFS2 filesystem


πŸŽ€ SYNOPSIS πŸŽ€

mkfs -t nilfs2 [ -b block-size ] [ -B blocks-per-segment ] [ -c ] [ -f ]
[ -K ] [ -L volume-label ] [ -m reserved-segments-percentage ] [ -n ] [
-O feature[,...]  ] [ -h ] [ -q ] [ -v ] [ -V ] device

mkfs.nilfs2 [ -b block-size ] [ -B blocks-per-segment ] [ -c ] [ -f ] [
-K ] [ -L volume-label ] [ -m reserved-segments-percentage ] [ -n ] [ -O
feature[,...]  ] [ -h ] [ -q ] [ -v ] [ -V ] device

πŸ’… DESCRIPTION πŸ’…

mkfs.nilfs2 is the girlboss that creates a nilfs2 filesystem β€” usually on a disk partition, no cap. device is the special file that corresponds to the device (like /dev/sdXX, iykyk). And fr fr, most of the time you're not even calling her directly β€” she gets invoked from the mkfs(8) front-end program. group project energy 🫢

The exit code mkfs.nilfs2 hands back is 0 on success and 1 on failure. periodt.


✨ OPTIONS ✨

  • -b block-size β€” sets the size of blocks, in bytes. the valid block sizes are 1024, 2048, 4096, 8192 bytes, ... and the maximum is capped at the system page size. for most machines that's 4096 bytes. default block size? also 4096 bytes. iconic consistency πŸ’«
  • -B blocks-per-segment β€” sets the number of blocks in a segment, where the segment (also called a full segment, cute) is the allocation unit of disk space in NILFS. this parameter gives you the size of the segment, which consequently decides how many segments get aligned in the specified device. default is 2048 blocks per segment (= 8MB with 4KB blocks). math ate πŸ”₯
  • -c β€” check the device for bad blocks before building the filesystem. safety first bestie 🧚
  • -f β€” force overwrite when there's already an existing filesystem detected on the device. by default mkfs.nilfs2 will not write to the device if she suspects there's already a filesystem on it. she's polite like that πŸ’…
  • -h β€” display the help message and exit. 🫢
  • -K β€” Keep, meaning do not attempt to discard blocks at mkfs time. (fun fact: discarding blocks initially is useful on solid state drives and on sparse / thinly-provisioned storage. so like, only skip it if you know.) πŸ‘‘
  • -L new-volume-label β€” set the volume label for the filesystem to new-volume-label. max length of the volume label is 80 bytes. no essays in the label please 😭
  • -m reserved-segments-percentage β€” specify the percentage of the segments reserved for garbage collection. default percentage is 5%. πŸ“
  • -n β€” cause mkfs.nilfs2 to not actually create a filesystem, but instead display what it would be do if it were to create a filesystem. window shopping mode πŸ™ˆ
  • -O feature[,...] β€” create a filesystem with the given features (filesystem options), overriding the default filesystem options.

the filesystem feature set is comprised of a list of features, separated by commas, that are to be enabled. to disable a feature, simply prefix the feature name with a caret ('^') character. and the pseudo-filesystem feature "none" will clear all filesystem features. choose your own adventure ✨

  • block_count β€” Enable block count per checkpoint.
  • -q β€” quiet execution. useful if mkfs.nilfs2 is run in a script. shhh 🀫
  • -v β€” verbose execution. tell me everything πŸ—£οΈ
  • -V β€” print the version number of mkfs.nilfs2 and exit. πŸ’–
⚠️ heads up bestie: -f is the one that actually overwrites an existing filesystem. by default she won't touch a device she thinks already has a filesystem on it, so don't go swinging -f around unless you mean it. πŸ’€

πŸ‘‘ AUTHOR πŸ‘‘

This version of mkfs.nilfs2 has been written by Ryusuke Konishi <konishi.ryusuke@gmail.com>. absolute legend, we stan 🌈


🌟 AVAILABILITY 🌟

mkfs.nilfs2 is part of the nilfs-utils package and is available from https://nilfs.sourceforge.io. go get her πŸ¦‹


πŸ’œ SEE ALSO πŸ’œ


and that's the whole page, bestie!! this one's from nilfs-utils version 2.3, dated Jan 2026 β€” so you know it's fresh ✨ mwah, go make some filesystems responsibly πŸ’–πŸŽ€πŸ«Ά

πŸ“¦ where this page comes from