Mount dd image with multiple partitions

dddisk-volumeimagemount

I have created an image of a disk using dd using the command dd if=/dev/sdb of=/jobs/image.dd. The SATA drive /dev/sdb has 3 partitions on it (one NTFS, two FAT32).

How do I mount the complete image with all its partitions in one go? I actually want to script this using Python but knowing how to do it is obviously the first step!

Thanks in advance

Best Answer

Use kpartx (from multipath-tools):

use losetup to get a /dev/loop? device, then use kpartx on it to create dev mappings for the partitions in the image file.