Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

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.

share|improve this answer

You could try:

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

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

share|improve this answer
2  
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" –  Mr Shunz 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 –  Mr Shunz Nov 18 '10 at 11:55

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.