Mounting a partitioned image in linux

From HeepyWiki
Revision as of 01:44, 4 September 2009 by Morris (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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