I downloaded an raw SD card image that has two partitions.

It caused some file system errors when I tried to dd it directly into an SD card. I am not sure if the card is defective or the image.

Is there a way to examine this image without writing it to a physical card? Like trying to mount the partitions separately or checking the tables?

link|improve this question

50% accept rate
feedback

2 Answers

up vote 2 down vote accepted

This answer on ServerFault suggests:

use losetup to get a /dev/loop? device, then use kpartx on it to create dev mappings for the partitions in the image file.

link|improve this answer
feedback

You could try:

mount -t type -o loop ./image /mnt

where "type" = fs type and "image" is the name of your downloaded file

link|improve this answer
1  
Thinking about it, that may not work with an image containing multiple partitions. – Tog Nov 16 '10 at 9:53
1  
you'll have to specify the offset of the single partition to mount with something like "mount -o loop,ro,offset=XXXXXXXX imagefile /mnt" – MrShunz Nov 16 '10 at 10:02
1  
Wouldn't losetup work to specify an offset? – Tog Nov 16 '10 at 11:47
you're right... with losetup you can set an offset to the partition to create a loopback device that can be simply mounted with mount /dev/loopX /mnt – MrShunz Nov 18 '10 at 11:55
feedback

Your Answer

 
or
required, but never shown

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