I have a DD image taken from the raw HDD image (/dev/sdb). This image file contains an XFS filesystem that I need to mount. It is much too large to restore to disks (2.6TB img file) so I would like to mount it using loopback.
However, the partition table becomes a problem. I tried to determine the partitions offset using both parted and fdisk -lu. Parted returns "unrecognized disk label", fdisk -lu shows me a blank partition table.
How would you recommend finding the partition start so that I can mount it with -o loop
The
kpartx
command will do all the work for you of detecting where the partitions exist and setting up loop devices with the appropriate offsets.See if testdisk can find your partition labels. You can try and see if
kpartx
can find and enable it first:Also remember to try those two things on a copy of the image. You don't want to destroy your backup image with tests.
You can use
sfdisk
to dump the partition table of the image. Pretty well any of the*fdisk
variants will do so, but some complain more than others. This will enable you to calculate the offset of the partition.Run
file - </dev/sdb
to see what you actually have on the disk, since it doesn't seem to be an image of a disk with a PC partition system.Given your comment, you probably have an LVM physical volume. So first associate a block device to it with
losetup
, then register the loop device as a physical volume and go on from there.kpartx was mentioned twice and you should use it! This post will give you some pratice with kpartx &Co.: Can I "atomically" swap a raid5 drive in Linux software raid?