Mounting a partitioned image in linux

From HeepyWiki
Jump to navigation Jump to search

To find and make available partitions in an image file of a partitioned medium:

losetup /dev/loop0 filename.img
kpartx -av /dev/loop0

this will create /dev/mapper/loop0pN...M (not in /dev!)

To clean up afterward, unmount any mounted partitions, then

kpartx -vd /dev/loop0
losetup -d /dev/loop0