kpartx man page

kpartx — Create device maps from partition tables


kpartx [-a | -d | -l] [-v] wholedisk


This tool, derived from util-linux' partx, reads partition tables on specified device and create device maps over partitions segments detected. It is called from hotplug upon device maps creation and deletion.


Add partition mappings
Read-only partition mappings
Delete partition mappings
Update partition mappings
List partition mappings that would be added -a
set device name-partition number delimiter
force creation of mappings; overrides 'no_partitions' feature
force GUID partition table (GPT)
Operate verbosely
Sync mode. Don't return until the partitions are created


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

multipath(8) multipathd(8) hotplug(8)


This man page was assembled By Patrick Caulfield for the Debian project. From documentation provided by the multipath author Christophe Varoqui, <christophe.varoqui@opensvc.com> and others.

Referenced By

guestfs(3), multipath(8), multipathd(8), tcplay(8).

Explore man page connections for kpartx(8).

July 2006