{
    "content": [
        {
            "type": "text",
            "text": "# mkfs.cramfs(8) (man)\n\n## TLDR\n\n> Create a ROM filesystem inside a partition.\n\n- Create a ROM filesystem out of a directory inside partition Y on device X:\n  `sudo mkfs.cramfs {{path/to/directory}} {{/dev/sdXY}}`\n- Create a ROM filesystem with a volume-name:\n  `sudo mkfs.cramfs -n {{volume_name}} {{path/to/directory}} {{/dev/sdXY}}`\n\n*Source: tldr-pages*\n\n---\n\n**Summary:** mkfs.cramfs - make compressed ROM file system\n\n**Synopsis:** mkfs.cramfs [options] directory file\n\n## Flags\n\n| Flag | Long | Arg | Description |\n|------|------|-----|-------------|\n| -v | — | — | Enable verbose messaging. |\n| -E | — | — | Treat all warnings as errors, which are reflected as command exit status. |\n| -b | — | — | Use defined block size, which has to be divisible by page size. |\n| -e | — | — | Use defined file system edition number in superblock. |\n| -N | — | — | Use defined endianness. Value defaults to host. |\n| -i | — | — | Insert a file to cramfs file system. |\n| -n | — | — | Set name of the cramfs file system. |\n| -p | — | — | Pad by 512 bytes for boot code. |\n| -s | — | — | This option is ignored. Originally the -s turned on directory entry sorting. |\n| -z | — | — | Make explicit holes. |\n| -h | --help | — | Display help text and exit. |\n| -V | --version | — | Display version information and exit. |\n\n## See Also\n\n- fsck.cramfs(8)\n- mount(8)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (2 lines)\n- **DESCRIPTION** (13 lines)\n- **ARGUMENTS** (5 lines)\n- **OPTIONS** (1 lines) — 12 subsections\n  - -v (2 lines)\n  - -E (2 lines)\n  - -b (2 lines)\n  - -e (2 lines)\n  - -N (2 lines)\n  - -i (2 lines)\n  - -n (2 lines)\n  - -p (2 lines)\n  - -s (2 lines)\n  - -z (2 lines)\n  - -h --help (2 lines)\n  - -V --version (2 lines)\n- **EXIT STATUS** (6 lines)\n- **SEE ALSO** (2 lines)\n- **REPORTING BUGS** (2 lines)\n- **AVAILABILITY** (6 lines)\n\n## Full Content\n\n### NAME\n\nmkfs.cramfs - make compressed ROM file system\n\n### SYNOPSIS\n\nmkfs.cramfs [options] directory file\n\n### DESCRIPTION\n\nFiles on cramfs file systems are zlib-compressed one page at a time to allow random read\naccess. The metadata is not compressed, but is expressed in a terse representation that is\nmore space-efficient than conventional file systems.\n\nThe file system is intentionally read-only to simplify its design; random write access for\ncompressed files is difficult to implement. cramfs ships with a utility (mkcramfs(8)) to pack\nfiles into new cramfs images.\n\nFile sizes are limited to less than 16 MB.\n\nMaximum file system size is a little under 272 MB. (The last file on the file system must\nbegin before the 256 MB block, but can extend past it.)\n\n### ARGUMENTS\n\nThe directory is simply the root of the directory tree that we want to generate a compressed\nfilesystem out of.\n\nThe file will contain the cram file system, which later can be mounted.\n\n### OPTIONS\n\n#### -v\n\nEnable verbose messaging.\n\n#### -E\n\nTreat all warnings as errors, which are reflected as command exit status.\n\n#### -b\n\nUse defined block size, which has to be divisible by page size.\n\n#### -e\n\nUse defined file system edition number in superblock.\n\n#### -N\n\nUse defined endianness. Value defaults to host.\n\n#### -i\n\nInsert a file to cramfs file system.\n\n#### -n\n\nSet name of the cramfs file system.\n\n#### -p\n\nPad by 512 bytes for boot code.\n\n#### -s\n\nThis option is ignored. Originally the -s turned on directory entry sorting.\n\n#### -z\n\nMake explicit holes.\n\n#### -h --help\n\nDisplay help text and exit.\n\n#### -V --version\n\nDisplay version information and exit.\n\n### EXIT STATUS\n\n0\nsuccess\n\n8\noperation error, such as unable to allocate memory\n\n### SEE ALSO\n\nfsck.cramfs(8), mount(8)\n\n### REPORTING BUGS\n\nFor bug reports, use the issue tracker at https://github.com/karelzak/util-linux/issues.\n\n### AVAILABILITY\n\nThe mkfs.cramfs command is part of the util-linux package which can be downloaded from Linux\nKernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>.\n\n\n\nutil-linux 2.37.2                            2021-06-02                               MKFS.CRAMFS(8)\n\n"
        }
    ],
    "structuredContent": {
        "command": "mkfs.cramfs",
        "section": "8",
        "mode": "man",
        "summary": "mkfs.cramfs - make compressed ROM file system",
        "synopsis": "mkfs.cramfs [options] directory file",
        "tldr_summary": "Create a ROM filesystem inside a partition.",
        "tldr_examples": [
            {
                "description": "Create a ROM filesystem out of a directory inside partition Y on device X",
                "command": "sudo mkfs.cramfs {{path/to/directory}} {{/dev/sdXY}}"
            },
            {
                "description": "Create a ROM filesystem with a volume-name",
                "command": "sudo mkfs.cramfs -n {{volume_name}} {{path/to/directory}} {{/dev/sdXY}}"
            }
        ],
        "tldr_source": "official",
        "flags": [
            {
                "flag": "-v",
                "long": null,
                "arg": null,
                "description": "Enable verbose messaging."
            },
            {
                "flag": "-E",
                "long": null,
                "arg": null,
                "description": "Treat all warnings as errors, which are reflected as command exit status."
            },
            {
                "flag": "-b",
                "long": null,
                "arg": null,
                "description": "Use defined block size, which has to be divisible by page size."
            },
            {
                "flag": "-e",
                "long": null,
                "arg": null,
                "description": "Use defined file system edition number in superblock."
            },
            {
                "flag": "-N",
                "long": null,
                "arg": null,
                "description": "Use defined endianness. Value defaults to host."
            },
            {
                "flag": "-i",
                "long": null,
                "arg": null,
                "description": "Insert a file to cramfs file system."
            },
            {
                "flag": "-n",
                "long": null,
                "arg": null,
                "description": "Set name of the cramfs file system."
            },
            {
                "flag": "-p",
                "long": null,
                "arg": null,
                "description": "Pad by 512 bytes for boot code."
            },
            {
                "flag": "-s",
                "long": null,
                "arg": null,
                "description": "This option is ignored. Originally the -s turned on directory entry sorting."
            },
            {
                "flag": "-z",
                "long": null,
                "arg": null,
                "description": "Make explicit holes."
            },
            {
                "flag": "-h",
                "long": "--help",
                "arg": null,
                "description": "Display help text and exit."
            },
            {
                "flag": "-V",
                "long": "--version",
                "arg": null,
                "description": "Display version information and exit."
            }
        ],
        "examples": [],
        "see_also": [
            {
                "name": "fsck.cramfs",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/fsck.cramfs/8/json"
            },
            {
                "name": "mount",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/mount/8/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 13,
                "subsections": []
            },
            {
                "name": "ARGUMENTS",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "-v",
                        "lines": 2,
                        "flag": "-v"
                    },
                    {
                        "name": "-E",
                        "lines": 2,
                        "flag": "-E"
                    },
                    {
                        "name": "-b",
                        "lines": 2,
                        "flag": "-b"
                    },
                    {
                        "name": "-e",
                        "lines": 2,
                        "flag": "-e"
                    },
                    {
                        "name": "-N",
                        "lines": 2,
                        "flag": "-N"
                    },
                    {
                        "name": "-i",
                        "lines": 2,
                        "flag": "-i"
                    },
                    {
                        "name": "-n",
                        "lines": 2,
                        "flag": "-n"
                    },
                    {
                        "name": "-p",
                        "lines": 2,
                        "flag": "-p"
                    },
                    {
                        "name": "-s",
                        "lines": 2,
                        "flag": "-s"
                    },
                    {
                        "name": "-z",
                        "lines": 2,
                        "flag": "-z"
                    },
                    {
                        "name": "-h --help",
                        "lines": 2,
                        "flag": "-h",
                        "long": "--help"
                    },
                    {
                        "name": "-V --version",
                        "lines": 2,
                        "flag": "-V",
                        "long": "--version"
                    }
                ]
            },
            {
                "name": "EXIT STATUS",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "REPORTING BUGS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AVAILABILITY",
                "lines": 6,
                "subsections": []
            }
        ]
    }
}