I backed up my raspbian using Win32DiskImager. Later, I noticed that my Raspberry Pi did not boot because the SD card was damaged. I tried to restore the backup but still the Raspberry Pi did not boot. I formatted the card, installed a new raspbian image and everything now works fine. Is there a way to somehow "mount" the image of my backed up old SD card and exctract some configuration files from it without having to boot the Raspberry?

Extract configuraiton files from raspbian image


I don't think it is worth trying to do this under windows because it does not play nice with ext4, which is the main partition in the raspbian image. What typically happens is it isn't recognized at all, and people are confused by the one small fat32 partition containing the kernel, bootloader, some firmware, etc.

I've described here how to examine and mount the two partitions typically used on raspberry pi distros (including raspbian) with linux commands. It boils down to:

mount -v -o offset=62914560 -t ext4 whatever.img /mnt/img/two

But do read the full instructions as your offset might be different. If you don't have a linux system besides the pi, download a liveCD. Your life in so far as it involves the pi will be much easier that way.

  • Thank you very much. I will try to do this on my debian virtual machine. I don't know why this image doesn't work when I install it to an sd card. I hope it is not damaged. – giovi321 Feb 2 '14 at 17:50

If you have additional USB key, use Unix tool dd:

# dd bs=4M if=path_to_.img of=/dev/letter_of_USB

Now, on USB, you have exacted image of your backup. I think it's also possible with Win32DiskImager. You should exact .img to USB key.

  • Ah but enedil, there's two partitions in the image... – goldilocks Feb 2 '14 at 11:31
  • dd would create partitions like on .img file. – enedil Feb 2 '14 at 11:32
  • Yes. But you still need to answer the question ;) I believe the OP is referring to an already existing .img. – goldilocks Feb 2 '14 at 11:33
  • Yes, I am referring to an existing .img that, when put into a SD card, makes the raspberry unable to boot. – giovi321 Feb 2 '14 at 17:51
  • @goldilocks It is an answer. You do that and on the USB, you can get important files. For other info man dd. – enedil Feb 2 '14 at 18:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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