- Let's have unknown disk drive uncompressed raw image (created for example by
dd if=/dev/sda of=image) in single file. - If we knew the disk layout, we could mount particular partitions from the file as the loop devices via skipping some offsets.
- Let's suppose we don't know the layout. Can we somehow "mount" the whole disk drive
image, which process would create virtual block devices according to the disk layout? For example having 2 partitions in theimagewould result in creating 3 devices (/dev/sdx,/dev/sdx1,/dev/sdx2). We could then mount such devices as usual.
Asked
Active
Viewed 1.2k times
4
sharpener
- 433
1 Answers
2
After some more research I have found, there are at least two methods to test:
- According to this post,
kpartxis applicable tool.- Unfortunately it didn't work on Arch Linux for me
- It's from AUR:
yaourt multipath-tools-git, seems to be not well supported/finished and ended up with errors like:device-mapper: reload ioctl on loop0p1 failed: No such device
- Can be at least used to list the embedded partitions:
kpartx -l image - EDIT: According to this post, it seems to be obsolete and the preferred method is the following one.
- According to this post,
losetupcan be used.- Firstly it didn't work:
losetup /dev/loop0 image(missing the devices for particular partitions). - Trying again using additional
-Poption did the work:losetup -d /dev/loop0,losetup -P /dev/loop0 imageand/dev/loop0pXdevices were created. - These devices are then mountable as expected, like
mount /dev/loop0p3 /mnt/x -t ntfs
- Firstly it didn't work: