I read the man pages on both, and they seems to be interchangeable and to be doing the same job.
So can someone explain when I should use partx, and when kpartx ?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityI read the man pages on both, and they seems to be interchangeable and to be doing the same job.
So can someone explain when I should use partx, and when kpartx ?
partx asks the kernel to probe a given device and re-read the partition table. The kernel is doing the work here.
kpartx creates device mapper entries and so can be used by devices that the kernel does not natively support partitioning, such as multipath device mapper devices ("kpartx" is part of multipath-tools) or files.
kpartx
to be the one relying on the kernel to do the work, rather than the other way around.
I think they are pretty much the same, but kpartx only deals with disk images while partx also allows you to map partitions within a block device.
kpartx
/ device-mapper. Either losetup -P
or partx -a /dev/loop0
are able to give you access to partitions on a loop device (disk image).
May 4, 2018 at 14:49