{
    "mode": "man",
    "parameter": "KPARTX",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/KPARTX/8/json",
    "generated": "2026-07-05T11:47:23Z",
    "synopsis": "kpartx [-a|-d|-u|-l] [-r] [-p] [-f] [-g] [-s|-n] [-v] wholedisk",
    "sections": {
        "NAME": {
            "content": "kpartx - Create device maps from partition tables.\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "kpartx [-a|-d|-u|-l] [-r] [-p] [-f] [-g] [-s|-n] [-v] wholedisk\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This  tool,  derived  from  util-linux' partx, reads partition tables on specified device and\ncreate device maps over partitions segments detected. It is called from hotplug  upon  device\nmaps creation and deletion.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-a",
                    "content": "",
                    "flag": "-a"
                },
                {
                    "name": "-d",
                    "content": "",
                    "flag": "-d"
                },
                {
                    "name": "-u",
                    "content": "",
                    "flag": "-u"
                },
                {
                    "name": "-l",
                    "content": "",
                    "flag": "-l"
                },
                {
                    "name": "-r",
                    "content": "",
                    "flag": "-r"
                },
                {
                    "name": "-p",
                    "content": "",
                    "flag": "-p"
                },
                {
                    "name": "-f",
                    "content": "",
                    "flag": "-f"
                },
                {
                    "name": "-g",
                    "content": "",
                    "flag": "-g"
                },
                {
                    "name": "-s",
                    "content": "",
                    "flag": "-s"
                },
                {
                    "name": "-n",
                    "content": "",
                    "flag": "-n"
                },
                {
                    "name": "-v",
                    "content": "",
                    "flag": "-v"
                }
            ]
        },
        "EXAMPLE": {
            "content": "To mount all the partitions in a raw disk image:\n\nkpartx -av disk.img\n\nThis will output lines such as:\n\nadd map loop1p1 (254:4): 0 409597 linear 7:1 3\n\nThe  loop1p1  is  the name of a device file under /dev/mapper which you can use to access the\npartition, for example to fsck it:\n\nfsck /dev/mapper/loop1p1\n\nWhen you're done, you need to remove the devices:\n\nkpartx -d disk.img\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "multipath(8) multipathd(8) hotplug(8)\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "This man page was assembled By Patrick Caulfield for the Debian project.\n\nmultipath-tools was developed by Christophe Varoqui <christophe.varoqui@opensvc.com> and oth‐\ners.\n\n\n\nLinux                                        2016-10-28                                    KPARTX(8)",
            "subsections": []
        }
    },
    "summary": "kpartx - Create device maps from partition tables.",
    "flags": [
        {
            "flag": "-a",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-d",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-u",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-l",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-r",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-p",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-f",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-g",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-s",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-n",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-v",
            "long": null,
            "arg": null,
            "description": ""
        }
    ],
    "examples": [
        "To mount all the partitions in a raw disk image:",
        "kpartx -av disk.img",
        "This will output lines such as:",
        "add map loop1p1 (254:4): 0 409597 linear 7:1 3",
        "The  loop1p1  is  the name of a device file under /dev/mapper which you can use to access the",
        "partition, for example to fsck it:",
        "fsck /dev/mapper/loop1p1",
        "When you're done, you need to remove the devices:",
        "kpartx -d disk.img"
    ],
    "see_also": [
        {
            "name": "multipath",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/multipath/8/json"
        },
        {
            "name": "multipathd",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/multipathd/8/json"
        },
        {
            "name": "hotplug",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/hotplug/8/json"
        }
    ]
}