if you need to mount/dump some partition on some image, let say on dump of mmcblk0 from embedded device, there is a way to do it:
- create loop device (must be repeated before any additional file processed by kpartx):
'losetup -f'
- create "looped" partitions
'kpartx -av some_dump_file'
- now you can do whatever you want on disk image and partitions like:
'sgdisk -p /dev/loopN'or
'dd if=/dev/mapper/loopNpNN of=dump_of_partition'
- when finished remove maps:
'kpartx -dv some_dump_file'