{
    "content": [
        {
            "type": "text",
            "text": "# MKFS.CRAMFS (man)\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\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## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **ARGUMENTS**\n- **OPTIONS** (13 subsections)\n- **EXIT STATUS**\n- **SEE ALSO**\n- **REPORTING BUGS**\n- **AVAILABILITY**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "MKFS.CRAMFS",
        "section": "",
        "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": "-l",
                "long": null,
                "arg": null,
                "description": "Use exclusive BSD lock for device or file it operates. The optional argument mode can be yes, no (or 1 and 0) or nonblock. If the mode argument is omitted, it defaults to \"yes\". This option overwrites environment variable $LOCKBLOCKDEVICE. The default is not to use any lock at all, but it’s recommended to avoid collisions with udevd or other tools."
            },
            {
                "flag": "-h",
                "long": "--help",
                "arg": null,
                "description": "Display help text and exit."
            },
            {
                "flag": "-V",
                "long": "--version",
                "arg": null,
                "description": "Print version 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": "-l",
                        "lines": 5,
                        "flag": "-l"
                    },
                    {
                        "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": 4,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "mkfs.cramfs - make compressed ROM file system\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "mkfs.cramfs [options] directory file\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Files 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",
                "subsections": []
            },
            "ARGUMENTS": {
                "content": "The 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",
                "subsections": []
            },
            "OPTIONS": {
                "content": "",
                "subsections": [
                    {
                        "name": "-v",
                        "content": "Enable verbose messaging.\n",
                        "flag": "-v"
                    },
                    {
                        "name": "-E",
                        "content": "Treat all warnings as errors, which are reflected as command exit status.\n",
                        "flag": "-E"
                    },
                    {
                        "name": "-b _",
                        "content": "Use defined block size, which has to be divisible by page size.\n",
                        "flag": "-b"
                    },
                    {
                        "name": "-e _",
                        "content": "Use defined file system edition number in superblock.\n",
                        "flag": "-e"
                    },
                    {
                        "name": "-N _",
                        "content": "Use defined endianness. Value defaults to host.\n",
                        "flag": "-N"
                    },
                    {
                        "name": "-i _",
                        "content": "Insert a file to cramfs file system.\n",
                        "flag": "-i"
                    },
                    {
                        "name": "-n _",
                        "content": "Set name of the cramfs file system.\n",
                        "flag": "-n"
                    },
                    {
                        "name": "-p",
                        "content": "Pad by 512 bytes for boot code.\n",
                        "flag": "-p"
                    },
                    {
                        "name": "-s",
                        "content": "This option is ignored. Originally the -s turned on directory entry sorting.\n",
                        "flag": "-s"
                    },
                    {
                        "name": "-z",
                        "content": "Make explicit holes.\n",
                        "flag": "-z"
                    },
                    {
                        "name": "-l",
                        "content": "Use exclusive BSD lock for device or file it operates. The optional argument mode can be\nyes, no (or 1 and 0) or nonblock. If the mode argument is omitted, it defaults to \"yes\".\nThis option overwrites environment variable $LOCKBLOCKDEVICE. The default is not to use\nany lock at all, but it’s recommended to avoid collisions with udevd or other tools.\n",
                        "flag": "-l"
                    },
                    {
                        "name": "-h --help",
                        "content": "Display help text and exit.\n",
                        "flag": "-h",
                        "long": "--help"
                    },
                    {
                        "name": "-V --version",
                        "content": "Print version and exit.\n",
                        "flag": "-V",
                        "long": "--version"
                    }
                ]
            },
            "EXIT STATUS": {
                "content": "0\nsuccess\n\n8\noperation error, such as unable to allocate memory\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "fsck.cramfs(8), mount(8)\n",
                "subsections": []
            },
            "REPORTING BUGS": {
                "content": "For bug reports, use the issue tracker at \u001b[34mhttps://github.com/util-linux/util-linux/issues\u001b[0m.\n",
                "subsections": []
            },
            "AVAILABILITY": {
                "content": "The mkfs.cramfs command is part of the util-linux package which can be downloaded from \u001b[34mLinux\u001b[0m\n\u001b[34mKernel Archive \u001b[0m<https://www.kernel.org/pub/linux/utils/util-linux/>.\n\nutil-linux 2.39.3                            2023-11-21                               MKFS.CRAMFS(8)",
                "subsections": []
            }
        }
    }
}