# How can I recover my flows from a bad SD card from a PI 3b\_ SD card

**URL:** <https://discourse.nodered.org/t/how-can-i-recover-my-flows-from-a-bad-sd-card-from-a-pi-3b-sd-card/48887>\
**Category:** General\
**Created:** [25 July 2021 17:58 UTC](https://discourse.nodered.org/t/how-can-i-recover-my-flows-from-a-bad-sd-card-from-a-pi-3b-sd-card/48887 "2021-07-25T17:58:55Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![ronbu](https://avatars.discourse-cdn.com/v4/letter/r/9e8a1a/32.png) [@ronbu](https://discourse.nodered.org/u/ronbu)\
**Post date:** [25 July 2021 17:58 UTC](https://discourse.nodered.org/t/how-can-i-recover-my-flows-from-a-bad-sd-card-from-a-pi-3b-sd-card/48887/1 "2021-07-25T17:58:55Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [25 July 2021 18:27 UTC](https://discourse.nodered.org/t/how-can-i-recover-my-flows-from-a-bad-sd-card-from-a-pi-3b-sd-card/48887/2 "2021-07-25T18:27:19Z")

</div>

/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.

---

<div class="post-metadata">

**Author:** ![gerry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gerry/32/21604_2.png) [@gerry](https://discourse.nodered.org/u/gerry)\
**Post date:** [25 July 2021 18:30 UTC](https://discourse.nodered.org/t/how-can-i-recover-my-flows-from-a-bad-sd-card-from-a-pi-3b-sd-card/48887/3 "2021-07-25T18:30:45Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ronbu](https://avatars.discourse-cdn.com/v4/letter/r/9e8a1a/32.png) [@ronbu](https://discourse.nodered.org/u/ronbu)\
**Post date:** [25 July 2021 18:54 UTC](https://discourse.nodered.org/t/how-can-i-recover-my-flows-from-a-bad-sd-card-from-a-pi-3b-sd-card/48887/4 "2021-07-25T18:54:01Z")

</div>

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,boot.dev,etc,home,lib, and many more.  
So question is where do I look to find the node-red and arduino files.

---

<div class="post-metadata">

**Author:** ![gerry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gerry/32/21604_2.png) [@gerry](https://discourse.nodered.org/u/gerry)\
**Post date:** [25 July 2021 19:00 UTC](https://discourse.nodered.org/t/how-can-i-recover-my-flows-from-a-bad-sd-card-from-a-pi-3b-sd-card/48887/5 "2021-07-25T19:00:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ronbu](https://avatars.discourse-cdn.com/v4/letter/r/9e8a1a/32.png) [@ronbu](https://discourse.nodered.org/u/ronbu)\
**Post date:** [25 July 2021 19:02 UTC](https://discourse.nodered.org/t/how-can-i-recover-my-flows-from-a-bad-sd-card-from-a-pi-3b-sd-card/48887/6 "2021-07-25T19:02:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![gerry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gerry/32/21604_2.png) [@gerry](https://discourse.nodered.org/u/gerry)\
**Post date:** [25 July 2021 19:07 UTC](https://discourse.nodered.org/t/how-can-i-recover-my-flows-from-a-bad-sd-card-from-a-pi-3b-sd-card/48887/7 "2021-07-25T19:07:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [25 July 2021 19:16 UTC](https://discourse.nodered.org/t/how-can-i-recover-my-flows-from-a-bad-sd-card-from-a-pi-3b-sd-card/48887/8 "2021-07-25T19:16:08Z")

</div>

Maybe something like - [raspbian - Recover files from broken sd card (no boot) - Raspberry Pi Stack Exchange](https://raspberrypi.stackexchange.com/questions/7489/recover-files-from-broken-sd-card-no-boot)

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

---

<div class="post-metadata">

**Author:** ![ronbu](https://avatars.discourse-cdn.com/v4/letter/r/9e8a1a/32.png) [@ronbu](https://discourse.nodered.org/u/ronbu)\
**Post date:** [25 July 2021 19:22 UTC](https://discourse.nodered.org/t/how-can-i-recover-my-flows-from-a-bad-sd-card-from-a-pi-3b-sd-card/48887/9 "2021-07-25T19:22:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [25 July 2021 19:25 UTC](https://discourse.nodered.org/t/how-can-i-recover-my-flows-from-a-bad-sd-card-from-a-pi-3b-sd-card/48887/10 "2021-07-25T19:25:43Z")

</div>

> [@ronbu](#):
>
> f 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,boot.dev,etc,home,lib, and many more.

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.

---

<div class="post-metadata">

**Author:** ![ronbu](https://avatars.discourse-cdn.com/v4/letter/r/9e8a1a/32.png) [@ronbu](https://discourse.nodered.org/u/ronbu)\
**Post date:** [25 July 2021 19:25 UTC](https://discourse.nodered.org/t/how-can-i-recover-my-flows-from-a-bad-sd-card-from-a-pi-3b-sd-card/48887/11 "2021-07-25T19:25:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ronbu](https://avatars.discourse-cdn.com/v4/letter/r/9e8a1a/32.png) [@ronbu](https://discourse.nodered.org/u/ronbu)\
**Post date:** [25 July 2021 19:33 UTC](https://discourse.nodered.org/t/how-can-i-recover-my-flows-from-a-bad-sd-card-from-a-pi-3b-sd-card/48887/12 "2021-07-25T19:33:48Z")

</div>

> [@jbudd](#):
>
> Or you may need to attempt a repair using **fsck** , again specifying ext4.

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

---

<div class="post-metadata">

**Author:** ![ronbu](https://avatars.discourse-cdn.com/v4/letter/r/9e8a1a/32.png) [@ronbu](https://discourse.nodered.org/u/ronbu)\
**Post date:** [25 July 2021 19:38 UTC](https://discourse.nodered.org/t/how-can-i-recover-my-flows-from-a-bad-sd-card-from-a-pi-3b-sd-card/48887/13 "2021-07-25T19:38:42Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [25 July 2021 19:40 UTC](https://discourse.nodered.org/t/how-can-i-recover-my-flows-from-a-bad-sd-card-from-a-pi-3b-sd-card/48887/14 "2021-07-25T19:40:27Z")

</div>

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

Paul

---

<div class="post-metadata">

**Author:** ![ronbu](https://avatars.discourse-cdn.com/v4/letter/r/9e8a1a/32.png) [@ronbu](https://discourse.nodered.org/u/ronbu)\
**Post date:** [25 July 2021 19:43 UTC](https://discourse.nodered.org/t/how-can-i-recover-my-flows-from-a-bad-sd-card-from-a-pi-3b-sd-card/48887/15 "2021-07-25T19:43:29Z")

</div>

no but I will now. thanks Paul.

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [25 July 2021 19:50 UTC](https://discourse.nodered.org/t/how-can-i-recover-my-flows-from-a-bad-sd-card-from-a-pi-3b-sd-card/48887/16 "2021-07-25T19:50:24Z")

</div>

> [@ronbu](#):
>
> it replied dirt found

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**

---

<div class="post-metadata">

**Author:** ![ronbu](https://avatars.discourse-cdn.com/v4/letter/r/9e8a1a/32.png) [@ronbu](https://discourse.nodered.org/u/ronbu)\
**Post date:** [25 July 2021 19:59 UTC](https://discourse.nodered.org/t/how-can-i-recover-my-flows-from-a-bad-sd-card-from-a-pi-3b-sd-card/48887/17 "2021-07-25T19:59:35Z")

</div>

> [@jbudd](#):
>
> "0x41: Dirty bit is set. Fs was not properly unmounted and some data may be corrupt."

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.

---

<div class="post-metadata">

**Author:** ![ronbu](https://avatars.discourse-cdn.com/v4/letter/r/9e8a1a/32.png) [@ronbu](https://discourse.nodered.org/u/ronbu)\
**Post date:** [25 July 2021 20:00 UTC](https://discourse.nodered.org/t/how-can-i-recover-my-flows-from-a-bad-sd-card-from-a-pi-3b-sd-card/48887/18 "2021-07-25T20:00:48Z")

</div>

by the way what does Fs mean? File system ?

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [25 July 2021 20:08 UTC](https://discourse.nodered.org/t/how-can-i-recover-my-flows-from-a-bad-sd-card-from-a-pi-3b-sd-card/48887/19 "2021-07-25T20:08:18Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [26 July 2021 23:01 UTC](https://discourse.nodered.org/t/how-can-i-recover-my-flows-from-a-bad-sd-card-from-a-pi-3b-sd-card/48887/20 "2021-07-26T23:01:15Z")

</div>

Ron, take a look at [How to recover a corrupted SD-Card (maybe!)](https://discourse.nodered.org/t/how-to-recover-a-corrupted-sd-card-maybe/48943) posted a few minutes ago by @TotallyInformation

[Next page](https://discourse.nodered.org/t/how-can-i-recover-my-flows-from-a-bad-sd-card-from-a-pi-3b-sd-card/48887.md?page=2)
