{
    "content": [
        {
            "type": "text",
            "text": "# mkfs(8) (man)\n\n## TLDR\n\n> Build a Linux filesystem on a hard disk partition.\n\n- Build a Linux ext2 filesystem on a partition:\n  `sudo mkfs {{/dev/sdXY}}`\n- Build a filesystem of a specified type:\n  `sudo mkfs {{-t|--type}} {{ext4}} {{/dev/sdXY}}`\n- Build a filesystem of a specified type and check for bad blocks:\n  `sudo mkfs -c {{-t|--type}} {{ntfs}} {{/dev/sdXY}}`\n\n*Source: tldr-pages*\n\n---\n\n**Summary:** mkfs - build a Linux filesystem\n\n**Synopsis:** mkfs [options] [-t type] [fs-options] device [size]\n\n## Flags\n\n| Flag | Long | Arg | Description |\n|------|------|-----|-------------|\n| -t | --type | — | Specify the type of filesystem to be built. If not specified, the default filesystem type (currently ext2) is used. fs-o |\n| -V | --verbose | — | Produce verbose output, including all filesystem-specific commands that are executed. Specifying this option more than o |\n| -V | --version | — | Display version information and exit. (Option -V will display version information only when it is the only parameter, ot |\n| -h | --help | — | Display help text and exit. |\n\n## See Also\n\n- fs(5)\n- badblocks(8)\n- fsck(8)\n- mkdosfs(8)\n- mke2fs(8)\n- mkfs.bfs(8)\n- mkfs.ext2(8)\n- mkfs.ext3(8)\n- mkfs.ext4(8)\n- mkfs.minix(8)\n- mkfs.msdos(8)\n- mkfs.vfat(8)\n- mkfs.xfs(8)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (2 lines)\n- **DESCRIPTION** (1 lines) — 1 subsections\n  - This mkfs frontend is deprecated in favour of filesystem spe (12 lines)\n- **OPTIONS** (1 lines) — 4 subsections\n  - -t --type (6 lines)\n  - -V --verbose (4 lines)\n  - -V --version (3 lines)\n  - -h --help (2 lines)\n- **BUGS** (4 lines)\n- **AUTHORS** (5 lines)\n- **SEE ALSO** (3 lines)\n- **REPORTING BUGS** (2 lines)\n- **AVAILABILITY** (6 lines)\n\n## Full Content\n\n### NAME\n\nmkfs - build a Linux filesystem\n\n### SYNOPSIS\n\nmkfs [options] [-t type] [fs-options] device [size]\n\n### DESCRIPTION\n\n#### This mkfs frontend is deprecated in favour of filesystem specific mkfs.<type> utils.\n\nmkfs is used to build a Linux filesystem on a device, usually a hard disk partition. The\ndevice argument is either the device name (e.g., /dev/hda1, /dev/sdb2), or a regular file\nthat shall contain the filesystem. The size argument is the number of blocks to be used for\nthe filesystem.\n\nThe exit status returned by mkfs is 0 on success and 1 on failure.\n\nIn actuality, mkfs is simply a front-end for the various filesystem builders (mkfs.fstype)\navailable under Linux. The filesystem-specific builder is searched for via your PATH\nenvironment setting only. Please see the filesystem-specific builder manual pages for further\ndetails.\n\n### OPTIONS\n\n#### -t --type\n\nSpecify the type of filesystem to be built. If not specified, the default filesystem type\n(currently ext2) is used.\n\nfs-options\nFilesystem-specific options to be passed to the real filesystem builder.\n\n#### -V --verbose\n\nProduce verbose output, including all filesystem-specific commands that are executed.\nSpecifying this option more than once inhibits execution of any filesystem-specific\ncommands. This is really only useful for testing.\n\n#### -V --version\n\nDisplay version information and exit. (Option -V will display version information only\nwhen it is the only parameter, otherwise it will work as --verbose.)\n\n#### -h --help\n\nDisplay help text and exit.\n\n### BUGS\n\nAll generic options must precede and not be combined with filesystem-specific options. Some\nfilesystem-specific programs do not automatically detect the device size and require the size\nparameter to be specified.\n\n### AUTHORS\n\nDavid Engel <david@ods.com>, Fred N. van Kempen <waltje@uwalt.nl.mugnet.org>, Ron Sommeling\n<sommel@sci.kun.nl>.\n\nThe manual page was shamelessly adapted from Remy Card’s version for the ext2 filesystem.\n\n### SEE ALSO\n\nfs(5), badblocks(8), fsck(8), mkdosfs(8), mke2fs(8), mkfs.bfs(8), mkfs.ext2(8), mkfs.ext3(8),\nmkfs.ext4(8), mkfs.minix(8), mkfs.msdos(8), mkfs.vfat(8), mkfs.xfs(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 command is part of the util-linux package which can be downloaded from Linux Kernel\nArchive <https://www.kernel.org/pub/linux/utils/util-linux/>.\n\n\n\nutil-linux 2.37.2                            2021-06-02                                      MKFS(8)\n\n"
        }
    ],
    "structuredContent": {
        "command": "mkfs",
        "section": "8",
        "mode": "man",
        "summary": "mkfs - build a Linux filesystem",
        "synopsis": "mkfs [options] [-t type] [fs-options] device [size]",
        "tldr_summary": "Build a Linux filesystem on a hard disk partition.",
        "tldr_examples": [
            {
                "description": "Build a Linux ext2 filesystem on a partition",
                "command": "sudo mkfs {{/dev/sdXY}}"
            },
            {
                "description": "Build a filesystem of a specified type",
                "command": "sudo mkfs {{-t|--type}} {{ext4}} {{/dev/sdXY}}"
            },
            {
                "description": "Build a filesystem of a specified type and check for bad blocks",
                "command": "sudo mkfs -c {{-t|--type}} {{ntfs}} {{/dev/sdXY}}"
            }
        ],
        "tldr_source": "official",
        "flags": [
            {
                "flag": "-t",
                "long": "--type",
                "arg": null,
                "description": "Specify the type of filesystem to be built. If not specified, the default filesystem type (currently ext2) is used. fs-options Filesystem-specific options to be passed to the real filesystem builder."
            },
            {
                "flag": "-V",
                "long": "--verbose",
                "arg": null,
                "description": "Produce verbose output, including all filesystem-specific commands that are executed. Specifying this option more than once inhibits execution of any filesystem-specific commands. This is really only useful for testing."
            },
            {
                "flag": "-V",
                "long": "--version",
                "arg": null,
                "description": "Display version information and exit. (Option -V will display version information only when it is the only parameter, otherwise it will work as --verbose.)"
            },
            {
                "flag": "-h",
                "long": "--help",
                "arg": null,
                "description": "Display help text and exit."
            }
        ],
        "examples": [],
        "see_also": [
            {
                "name": "fs",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/fs/5/json"
            },
            {
                "name": "badblocks",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/badblocks/8/json"
            },
            {
                "name": "fsck",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/fsck/8/json"
            },
            {
                "name": "mkdosfs",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/mkdosfs/8/json"
            },
            {
                "name": "mke2fs",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/mke2fs/8/json"
            },
            {
                "name": "mkfs.bfs",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/mkfs.bfs/8/json"
            },
            {
                "name": "mkfs.ext2",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/mkfs.ext2/8/json"
            },
            {
                "name": "mkfs.ext3",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/mkfs.ext3/8/json"
            },
            {
                "name": "mkfs.ext4",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/mkfs.ext4/8/json"
            },
            {
                "name": "mkfs.minix",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/mkfs.minix/8/json"
            },
            {
                "name": "mkfs.msdos",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/mkfs.msdos/8/json"
            },
            {
                "name": "mkfs.vfat",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/mkfs.vfat/8/json"
            },
            {
                "name": "mkfs.xfs",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/mkfs.xfs/8/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 1,
                "subsections": [
                    {
                        "name": "This mkfs frontend is deprecated in favour of filesystem specific mkfs.<type> utils.",
                        "lines": 12
                    }
                ]
            },
            {
                "name": "OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "-t --type",
                        "lines": 6,
                        "flag": "-t",
                        "long": "--type"
                    },
                    {
                        "name": "-V --verbose",
                        "lines": 4,
                        "flag": "-V",
                        "long": "--verbose"
                    },
                    {
                        "name": "-V --version",
                        "lines": 3,
                        "flag": "-V",
                        "long": "--version"
                    },
                    {
                        "name": "-h --help",
                        "lines": 2,
                        "flag": "-h",
                        "long": "--help"
                    }
                ]
            },
            {
                "name": "BUGS",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "AUTHORS",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "REPORTING BUGS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AVAILABILITY",
                "lines": 6,
                "subsections": []
            }
        ]
    }
}