I have an SD card with raspbian on it that I was using on a Raspberry Pi model B+. While logged into the pi, I wrote some code in .cpp files which were then saved on the Pi.

Now unfortunately the Pi no longer works, is there any way to get my .cpp files off the SD card without getting another Pi?


Is there a card reader you can use? If so, you could use Ext2Read on Windows or simply mount and copy/paste your files on Linux.


woops didn't see the answer above

  • Excellent! This saved me so much time because otherwise I would have had to write the code all over again, thank you! – oodan123 Nov 19 '15 at 3:40
  • Thanks a lot...That's saved the day...Great exe file to read the Disc Image files on the SD card. – HassanSh__3571619 Oct 24 '19 at 12:25

Insert the SD card on another Linux system, and observe the SD card reference through the output of dmesg. Usually it is in the form like the example below

[ 9844.823326] sda: sda1 sda2 [ 9844.825765] sd 0:0:0:0: [sda] Attached SCSI removable disk

As root user, you can mount the second partition that holds your pi's home directory

root@homerpi:/home/pi# mount /dev/sda2 /mnt root@homerpi:/home/pi# cd /mnt


  • Thank you for your answer! Unfortunately I am using Windows so leriaz's answer was the one I ended up going with – oodan123 Nov 19 '15 at 3:41

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