Start by making an image of your SD card (e.g. ). Trying to fix existing filesystem errors on a failing SD card will produce new errors in relocated sectors, and fixing those will produce more errors etc. You can skip this step if you're certain your SD card is OK, but if the data you're trying to recover is really important, I wouldn't take this risk.dd if=/dev/mmcblk0 of=backup.img bs=4M
Once you have your backup image, put it on a loopback device (). The first step is to understand if the partition table is OK or not: on a typical NOOBS installation you should see the RECOVERY partition losetup -P /dev/loop0 backup.img, the SETTINGS partition /dev/loop0p1 and a couple of system partitions for each system you have installed, typically /dev/loop0p3 and /dev/loop0p5. /dev/loop0p6 will be helpful here, as it can show you the labels of the partitions it detects. Note that if you decided to forego the backup copy and work with your SD card, you'll have the same partitions, only with gparted or /dev/mmcblk0 (for USB card readers) instead of /dev/sda, and you simply need to plug the SD card instead of using /dev/loop0.losetup
If the information you need was stored in the home folder of the user, it will be on pi. Otherwise, you have to remember where you actually stored it./dev/loop0p6
If you don't see the partition you need, you'll have to recover the partition table and/or partition superblocks. I recommend doing this with , but there are other tools you may be more familiar with (testdisk, fidsk, etc.). If you have no experience, find a tutorial online (here's one for parted) or ask someone knowledgeable to do it for you. Once you do the necessary changes, run testdisk to unbind the loop device and losetup -d /dev/loop0 to rescan the partition table again. If you're working on an actual SD card, unplug it and replug it again.losetup -P /dev/loop0 backup.img
Once you get the partition you need to show up, mount it read-only () and see if you can find the files you need there. If not, unmount the partition and try to fix it with mount -o ro,loop /dev/loop0p6 /mnt/recovery. If fsck /dev/loop0p6 reports errors, fix them with fsck, mount the partition again and see if it helped.fsck -y /dev/loop0p6