Donnerstag, 24. Juni 2010

mount partition of dd image of hard disk

If you did a backup of a hard disk with the dd command then you stored
everything including the partition table.
If you want to mount one partition of this backup only to a folder then you need to do the following:

1) losetup /dev/loop0 /home/proc/file
2) fdisk -lu /dev/loop0 then you will see the partitions and the number of the blocks where they start. If you want to mount the partition number 3 then read the number there. Let's say it is N
3) losetup -d /dev/loop0 (release the loop device)
4) losetup /dev/loop0 /home/proc/file -o $((N*512))
5) mount /dev/loop0 disk

Keine Kommentare: