Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've a disk image done with dd:

dd if=/dev/sda of=/mnt/fulldisk.img

/dev/sda have some partitions (Windows+Linux)

My problem is: I need to know if the image is done well, how can I access data? (especially Linux data)

I've tried with Windows utilities like ext2explorer or directly mounting the image, but I cannot access data.

Is there a way to do it (with Windows or Linux)?

share|improve this question
    
Can you post the command and the error you got when you tried this? –  Khaled Jan 16 '12 at 7:56
    
There's no error (i'm trying to mount it in windows), simply, don't do nothing, when I try other ways i get some 'data corrupted' message (but i think that's the system get some raw data that it cannot undestand. –  Ferran Jan 16 '12 at 8:14
    
Did you try to mount it under Linux? Linux can understand Windows partitions as well. –  Khaled Jan 16 '12 at 8:20
add comment

2 Answers

In Linux you can use kpartx. First see with kpartx -l /mnt/fulldisk.img to see if it can recognize the partition layout. If it can, kpartx -a /mnt/fulldisk.img makes your partitions available under /dev/mapper/loop0pX where X is partition number.

You can then mount those partitions with

mount -o loop /dev/mapper/loop0pX /some/mount/point

Just replace X with your desired partition number.

After you are finished, use umount /some/mount/point and kpartx -d /mnt/fulldisk.img to properly disconnect your disk image.

share|improve this answer
1  
Thanks a lot! There's a way to do it under windows also? With linux, I've found also those method: get and calculate the offset of the partition and mount using: mount -o loop,offset=xxx image /mnt but it seems a very raw option... –  Ferran Jan 16 '12 at 8:36
add comment

All recent kernels (it was added somewhere around 2.6.2x) support partition tables on loop devices. Only the default is to disable this.

modinfo loop should give you information whatever it supports a max_part parameter. If it does, add to modprobe.conf

options loop max_part=16

and do rmmod loop and modprobe loop (all loop devices must be unused for it to work). This way, when mounting a single image using a loop device, all partitions will be automatically available:

losetup /dev/loop0 /mnt/fulldisk.img
mount /dev/loop0p1 /mnt/part1
mount /dev/loop0p2 /mnt/part2
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.