fabiostyler
Posts: 3
Joined: Wed Jun 03, 2020 12:46 pm

Recover the important files

Wed Jun 03, 2020 1:34 pm

Hello everybody,
an hour age my raspberry pi 4 got stuck while updating (apt-get upgrade...) and now I am unable to get him booting. The boot partition is there but seems corrupt, but I cant seem to get the other partition to show up although it must be somewhere. I really dont care about settings or things I only want some files off the sd card / pi. Please if just someone could help me..
Thanks in advance

User avatar
B.Goode
Posts: 14669
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Recover the important files

Thu Jun 04, 2020 6:49 am

fabiostyler wrote:
Wed Jun 03, 2020 1:34 pm
Hello everybody,
an hour age my raspberry pi 4 got stuck while updating (apt-get upgrade...) and now I am unable to get him booting. The boot partition is there but seems corrupt, but I cant seem to get the other partition to show up although it must be somewhere. I really dont care about settings or things I only want some files off the sd card / pi. Please if just someone could help me..
Thanks in advance

A couple of possible solutions -

Write a fresh installation of RasPiOS to a new or spare microSD card. (NOT the corrupt one you hope to recover data from.)
Boot your RPi4 board using that. Then use a usb microSD card reader 'dongle' to read your suspect card, if possible.



Or use a Linux distribution such as The Raspberry Pi Desktop OS for PC and Mac - https://www.raspberrypi.org/downloads/r ... i-desktop/ - as a Live CD to boot up a 'Windows PC' and use the usb card reader there to recover your data.

fabiostyler
Posts: 3
Joined: Wed Jun 03, 2020 12:46 pm

Re: Recover the important files

Thu Jun 04, 2020 7:21 am

Well, I have tried it, but none of the data is showing up, only the "boot" partition on Raspbian and Windows, I have also tried ext2explore which doesnt seem any different.

User avatar
B.Goode
Posts: 14669
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Recover the important files

Thu Jun 04, 2020 8:20 am

fabiostyler wrote:
Thu Jun 04, 2020 7:21 am
Well, I have tried it, but none of the data is showing up, only the "boot" partition on Raspbian and Windows, I have also tried ext2explore which doesnt seem any different.

The fact that a Windows Operating System will only report the presence of the boot partition is well known and unsurprising, which is why using Windows was not mentioned in my reply.

That doesn't help with your problem. But if you cannot find and access the root filesystem on your microSD card when you try to access it from another Linux system then your data is probably unrecoverable.

jbudd
Posts: 2091
Joined: Mon Dec 16, 2013 10:23 am

Re: Recover the important files

Thu Jun 04, 2020 9:44 am

With your Pi booting from another SD card and the bad card in a USB card reader, what do sudo fdisk -l and mount show you?

fabiostyler
Posts: 3
Joined: Wed Jun 03, 2020 12:46 pm

Re: Recover the important files

Thu Jun 04, 2020 11:30 am

fdisk shows 2 partitions from the active sd card and 1 "boot" partition from the corrupt one

jbudd
Posts: 2091
Joined: Mon Dec 16, 2013 10:23 am

Re: Recover the important files

Thu Jun 04, 2020 12:02 pm

I suppose it depends how important the missing data is.

You can presumably make a bit by bit image of the bad sd card with Win32DiskImager.
Write this image to another SD card and you can try data recovery tools on it. Some, eg Disk Drill claim to be able to recover ext4 data from a WIndows PC.
You could try manually creating an ext4 partition to fill the "unallocated" space on the SD copy. Maybe the files will just be there, or run fsck.ext4 on the partition.

fruitoftheloom
Posts: 27225
Joined: Tue Mar 25, 2014 12:40 pm

Re: Recover the important files

Thu Jun 04, 2020 12:13 pm

fabiostyler wrote:
Thu Jun 04, 2020 11:30 am
fdisk shows 2 partitions from the active sd card and 1 "boot" partition from the corrupt one

Linux gparted software has a data recovery option, do not know if will work with a USB MSD ?

https://gparted.org/display-doc.php%3Fn ... ata-rescue

Also TestDisk / Photorec are in the repositories, do not know if will work with USB MSD ?

https://packages.debian.org/buster/testdisk

https://packages.debian.org/buster/gparted
Take what I advise as advice not the utopian holy grail, and it is gratis !!

User avatar
Botspot
Posts: 1843
Joined: Thu Jan 17, 2019 9:47 pm
Location: Texas

Re: Recover the important files

Thu Jun 04, 2020 2:11 pm

This is a duplicate!
See: viewtopic.php?f=28&t=276050

Return to “Troubleshooting”