How can I recover my flows from a bad SD card from a PI 3b_ SD card

Ok my bad I do not have a backup of the SD card from
my PI 3b+. The card crashed and had ALL my flows and Arduino code.
I have a new install on a NEW SD card setup and SD reader attached
to the PI. I can see the SD card and folders BUT I don't know what I am
doing as to where to look for the flows and the Arduino files. I could use some help.
I have tried all the fixes (fsck,fdisk ect) but it will not boot but I do see it as stated.
I will be on line all day. Thanks. Ronbu.

/home/pi/.node-red should have your flows in flow_HOSTNAME.json.
flows_HOSTNAME_cred.json has stuff such as node settings, api keys etc.

Install node-red on the new sd card, start it and visit the editor.
Install the extra nodes that you use, then stop node-red. (Maybe create a flow with just an inject)
Then you should be able to copy over the files from the old card.

It might be OK to copy the entire .node-red directory, I've never tried that.

If you copy over the node red directory and all sub folders you will get all the nodes and flows you had before. That is a good node red total backup.

hello and thanks...but it's not that easy.. IE when I put SD card into the PI i see it come up as
"boot" an Icon. when I double click it it load the file manager and I see "root" and "boot"
if I click Root it throws this error "error mounting /fdev/sdb7 at media/pi/root. wrong fs type,ect ect
if I click on "boot" in file mang. I get a folder called overlays and a lot of files like this "bcm2708-rpi.dtb." lots of them.
Now on the left hand pane in F.M. I see folder listed such as /,bin,,etc,home,lib, and many more.
So question is where do I look to find the node-red and arduino files.

What are you trying to read the SD card in? It sounds like you can't see the linux files.

on PI 3b+ card pluged into the PI 3 with the card reader adpt.

You state the card crashed so it's possible that your file structure is corrupt and as such, unreadable. There may be tools you can run against the card to try to recover your data but I don't have any recommendations as to what those might be and I'm out of suggestions, sorry

Maybe something like - raspbian - Recover files from broken sd card (no boot) - Raspberry Pi Stack Exchange

The files that you want to recover live in the root partition.

yes I agree but what I don't understand is why I can see all those file in the first place.
if I plug it into a win 10 pc I see the files as well so I don't know. Thank you for your help I guess I just bit the bullet

The card has two filesystems : boot and root.
When the Pi is running, they are "mounted" as directories /boot and / ("/" is pronounced "root")
/ contains several directories as you have observed. /bin /usr /home etc.

Because you have Raspberry Pi OS running, / and /boot are the filesystems on your new card. so you won't find anything from the old card there. Instead the relevannt fs on the old card should be mounted at /media/pi/root. But you got a mount error.

It may be that you can mount it at another directory, eg sudo mkdir /media/pi/oldcard. Check man mount for how to mount it specifying filesystem type ext4.

Or you may need to attempt a repair using fsck, again specifying ext4.

I have no idea where arduino files might live.

So then what I am seeing is the boot and not the root. Yep that's why I can't find them.. Ok thanks. Ronbu

I did try that. it replied dirt found and asked if I want to repair I did but still no bootup. I will try the re-name and give that a shot. Thanks

one last question to all of this. On a windows pc you have the option to load a new v. of the OS. and not wipe out your files/data can that be done in linux or the PI as well?

@ronbu did you see the link above that I posted.


no but I will now. thanks Paul.

I've never seen that. I have seen a message like this
"0x41: Dirty bit is set. Fs was not properly unmounted and some data may be corrupt."

It's best not to paraphrase Linux error messages, the precise wording might help someone track down the actual error.

ps if you do manage to get to the files on the old SD, it's probably a good idea to use tar to make an archive of them to copy to the new cd because tar will preserve ownership and permissions.
cd /media/usb/oldcard; tar cvf /home/pi/nodered.tar .node-red
and to copy the files to the new card
cd /home/pi; tar xvf nodered.tar

yes you are right I don't remember but that sounds right dirty bit is set. but I said yes to fix.. but still no boot.

by the way what does Fs mean? File system ?

FS is short for filesystem yes.

I suspect that your booting problem could be corruption in the boot filesystem. The dirty bit should not prevent boot.

The dirty bit just indicates that something prevented the system from completing a task in the filesystem. It isn't necessarily a major problem.

Ron, take a look at How to recover a corrupted SD-Card (maybe!) posted a few minutes ago by @TotallyInformation