1) Connect the image as "loop" device:
Code: Select all
$ losetup <image_filename.img>
If this doesn't work (for whatever reason), you can do it manually.Loop device is /dev/loop0
Check the next available/free loop device:
Code: Select all
$ losetup -f
(Because loop0 and loop1 are taken by the live distro)./dev/loop2
Then assign the image to that loop device:
Code: Select all
$ losetup /dev/loop2 <image_filename.img>
Code: Select all
$ sudo kpartx -av /dev/loop0
3) Mount the desired partition(s):add map loop0p1 (253:0): 0 20967424 linear /dev/loop0 2048
Code: Select all
$ mount /dev/mapper/loop0p1 <mountpoint>
Unmounting is basically the same in reverse order with "delete" arguments:
Code: Select all
$ unmount /mnt
$ kpartx -dv /dev/loop0
$ losetup -d /dev/loop0