MKFS.CRAMFS(8)

๐Ÿ’พ MKFS.CRAMFS โ€” make compressed ROM file system โœจ

okay so bestie, quick vibe check: this is mkfs.cramfs, and she lives in section 8 of the manual, aka System Administration โ€” the big-girl section where all the stuff that can actually touch your filesystem hangs out. buckle up, we're packing a whole directory tree into one compressed little cutie ๐ŸŽ€


๐ŸŒธ NAME ๐ŸŒธ

mkfs.cramfs โ€” make compressed ROM file system


โœจ SYNOPSIS โœจ

mkfs.cramfs [options] directory file

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

So here's the tea. On a cramfs file system, files are zlib-compressed one page at a time, which is the whole trick that lets you do random read access. The metadata? Not compressed, bestie. But it is expressed in a terse representation that's more space-efficient than conventional file systems. it's giving minimalism, and honestly? it ate. ๐Ÿ’…

The file system is intentionally read-only โ€” like, on purpose โ€” because it simplifies the design. Random write access for compressed files is genuinely difficult to implement, so they simply did not. cramfs ships with a utility (mkcramfs(8)) to pack files into new cramfs images.

File sizes are limited to less than 16 MB. (yes, MB, not GB. she's small and she knows it ๐Ÿ“)

Maximum file system size is a little under 272 MB. (The last file on the file system must begin before the 256 MB block, but can extend past it.)


๐ŸŒˆ ARGUMENTS ๐ŸŒˆ

  • directory โ€” this is simply the root of the directory tree that we want to generate a compressed filesystem out of.
  • file โ€” this will contain the cram file system, which later can be mounted.

๐Ÿ‘‘ OPTIONS ๐Ÿ‘‘

  • -v โ€” Enable verbose messaging. she will tell you everything ๐Ÿ—ฃ๏ธ
  • -E โ€” Treat all warnings as errors, which are reflected as command exit status.
  • -b blocksize โ€” Use defined block size, which has to be divisible by page size.
  • -e edition โ€” Use defined file system edition number in superblock.
  • -N big|little|host โ€” Use the specified endianness. The default is host.
  • -i file โ€” Insert a file to cramfs file system.
  • -n name โ€” Set name of the cramfs file system.
  • -p โ€” Pad by 512 bytes for boot code.
  • -s โ€” This option is ignored. Originally the -s turned on directory entry sorting. (she's retired, show some respect ๐Ÿ™ˆ)
  • -z โ€” Make explicit holes.
  • -l[=mode] โ€” Use an exclusive BSD lock for the device or file that is operated upon. The optional argument mode can be yes (1), no (0), or nonblock. If the mode argument is omitted, it defaults to yes. This option overrides the environment variable $LOCK_BLOCK_DEVICE. The default is to not use any lock at all, but using a lock is recommended to avoid collisions with systemd-udevd(8) or other tools.
  • -h, --help โ€” Display help text and exit.
  • -V, --version โ€” Display version and exit.

๐Ÿ’€ EXIT STATUS ๐Ÿ’€

  • 0 โ€” success ๐ŸŽ‰
  • 8 โ€” operation error, such as unable to allocate memory

๐Ÿ”ฅ SEE ALSO ๐Ÿ”ฅ

fsck.cramfs(8), mount(8)


๐Ÿซถ REPORTING BUGS ๐Ÿซถ

For bug reports, use the issue tracker <https://github.com/util-linux/util-linux/issues>.


โญ AVAILABILITY โญ

The mkfs.cramfs command is part of the util-linux package which can be downloaded from Linux Kernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>.


no cap, if something's weird, file it in the tracker โ€” the maintainers are literally the main characters of this whole story ๐Ÿ’œ

and that's the whole page, bestie!! this was util-linux 2.42.4, dated 2026-09-21, and the page you just read is MKFS.CRAMFS(8). go forth and compress, icon ๐Ÿ’–โœจ

๐Ÿ“ฆ where this page comes from
  • arch rolling: util-linux 2.42.4-1 ยท BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND ISC AND LGPL-2.1-or-later AND LicenseRef-PublicDomain
  • ๐Ÿ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms