Mount a partimage file as a loopback device
Note: most (if not all) commands have to be issued as root. sudo is your friend.
Note: we're dealing with images of entire partitions. This means that you need a lot of free space on disk to work. You've been warned.
- Check whether the partimage file is compressed:
file -s <image file name>
if so, first of all gunzip it. Hereafter we assume you've an uncompressed partimage dump file.
- Create a file to receive the partimage dump. Size the file as if it were a partition, wide enough to hold the partimage dump
check how much space you need with
partimage imginfo <image file name>
Then use dd to create the image file
dd if=/dev/zero of=<image file name> bs=1024 count=0 seek=$[1024*1024*<size in GB>]
- Associate that file to a block device, use a free device under /dev/loop*
losetup /dev/loop0 <image file name>
- Do a partimage restore
partimage /dev/loop0 <partimage image file>
- Remove the file from the loopback
- Finally, mount the image file
mount <image file name> <mountpoint> -o loop
- You can also mount directly the loop device:
mount -t <file system type> /dev/loop/0 <mountpoint>