sarmadmahmood969
Posts: 2
Joined: Wed Aug 01, 2018 6:03 pm

How to recover files from pi SD card which can't boot

Sat May 11, 2019 10:38 am

My SD card is not booting more. This is the error end Kernel panic - not sycing: VFS: Unable to mount root fs on unknown-black(179,2) I tried many wasy to boot it that are given on internet, no solution work. Now the issue is I did lot of programming work on it and my program file is reside in it. Its effort of many days and night. I want to recover that .py file.

I tried many ways to recover that file also, I don't find solution of it. When I open it on windows or Linux system via SD card reader or USB card reader it only shows one boot partition containing all those files that are usually reside when we first time write SD card with raspbian operating system.

I also tried this solution that is given in answer but it didn't work:

when I paste this command in terminal:

Code: Select all

sudo fdisk -l /dev/sdb
it showed sdb1 and sdb2 partitions.

Then I used

Code: Select all

sudo e2fsck /dev/sdb2
, it showed
rootfs: **** WARNING: Filesystem still has errors *****
So the next command

Code: Select all

sudo mount /dev/sdb2 /mnt/
whatever not work and showed that
mount: /mnt/whatever: mount point does not exist
.

Is there any way to recover that programming file. If yes kindly provide me solution of that. I will be very thankful to one who solve my problem!

User avatar
HawaiianPi
Posts: 5888
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: How to recover files from pi SD card which can't boot

Sat May 11, 2019 10:47 am

The mount point must exist before you can use it.

Either just use /mnt

Code: Select all

sudo mount -t ext4 /dev/sdb2 /mnt


Or create a folder where you want the mount point.
sudo mkdir /mnt/whatever
sudo mount -t ext4 /dev/sdb2 /mnt/whatever

Of course this assumes you are doing this from a Linux computer (like another Pi running Raspbian), because it won't work from WSL.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

User avatar
DougieLawson
Posts: 39304
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: How to recover files from pi SD card which can't boot

Sat May 11, 2019 12:14 pm

First thing you MUST do (if the GUI is running) is umount the file systems (before you can fsck then). The GUI includes an auto-mounter that's enabled by default.

sudo umount /dev/sda1; sudo umount /dev/sda2; sudo fsck -f -y /dev/sda1; sudo fsck -f -y /dev/sda2
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Return to “Troubleshooting”