SSD card crashed, moving backups Q

Hi All,

The bad news is, my card crashed. The so-so news is I made an image file the day before the crash, but it won't boot. So I'm starting from a 10 month old (pre N-R) image and having to add my stuff back.

So far, I've installed N-R using the Raspbian script. I have both my (non-booting) image file and a folder with it's extracted contents on a removable HDD. I need to know what constitutes "my" files - in other words, what exactly needs to be moved from either the image or folder to the pi's file system for a "restore"?

Thanks!

Russ

First, if you image is not Buster Raspbian then I suggest starting with a fresh Raspbian as otherwise you will be working with an old version.
This assumes you were not using the projects feature. If you were then someone else will have to tell you what to do. Otherwise:
Stop node red, restore everything in the .node-red folder except the node_modules folder (which is large and must be rebuilt anyway).
The go into your .node-red folder and run
npm install
You might have to have a cup of coffee while it does it. Then start node-red.

Colin, I did the update/upgrade on my 10 month-old install before installing N-R and Samba yesterday so it should be up to date. So, after copying my .node-red folder (minus node_modules) do I still run npm install from within?

Thanks!

Russ

Yes, do npm install one time inside ~/.node-red, otherwise the any contrib nodes will be missing.

Whoo-hoo, back in business! Got 3 new 64g cards and a USB reader coming today, hopefully won't get caught out again...

Thanks guys!

Russ

1 Like

Personally, I would always choose to build a replacement card from scratch to get the latest OS and clean out the cruft that always seems to accumulate in a running OS version. It saves a lot of long-term pain.

I generally prefer install instructions over backups for the same reason. Backups accumulate rubbish that then gets put back. I've tried scripting installs as well but frankly it is so rare to have to rebuild that the scripts are usually just slightly out of kilter by the time you come to run them next so you really don't have anything. This is for a home installation of course, a professional or commercial installation would warrant the use of scripting and templates.

Yeah, I need to write this down while it's in my head (and browser history). I pretty much did this one from scratch and it was...not too difficult - with help! Pretty much much just N-R, Samba, OpenVPN, and my Chrome settings. I'm gonna do a "cheat sheet" so it won't be so painful next time. Plugging a cloned card into my new pi should result in a minimum of changes, mostly hostname, IP, MAC address type stuff?

Russ

Good idea to keep copies of key config files and all of the Node-RED stuff of course :smiley:

I was lucky enough to extract these files from my non-booting image file using a trial version of Paragon's ExtFS for Windows, I think the cost is $19.99. Prolly a bunch of great stuff out there for Linux. Not sure if I'm gonna stay with Windows much longer, the more I "find out" (can't say learn yet) about Raspbian, the more I'm liking the Linux OS.

Russ

1 Like

You no longer need to get anything else to access Linux file systems. Just use the WSL.

Linux is great for servers but horrid for desktops.

Kind of agree. Unless you put a new "shell" on top of it. Like macOS, is not too bad :wink:

On topic: I have a small usb card reader permanently installed in all of RPi's and make regular backups using the simple to use tool "SD Card Copier". Saved my day at least once

That is of course a matter of opinion, many would not agree with you.

2 Likes

MacOS is actually build on BSD, another UNIX-like OS similar to but not the same as Linux :wink:

I've not yet found a Linux OS shell that comes anywhere close to having the support and consistency of Windows (by consistency I mean the shear volume of applications that are generally comprehendible because they use common interface standards-ish). Really not surprising considering the trillions of dollars spend on developement of Windows and its many applications. MacOS of course comes close and many people prefer it for it's apparent simplicity. But for those of us who started on mainframes, participated in the development of standards around OS/2, LANmanager and Windows, MacOS is a bit of a pain in itself :smiley:

Everything except the simplest of tasks gains just a little (sometimes a lot) more friction. Whilst things have improved massively over the years, Linux simple doesn't get the desktop investment that it would need to realistically compete with Windows or MacOS. Even some of the largest deployments of Linux desktops have hit many roadblocks and had to scale back over the years as the anticipated benefits were never realised (e.g. parts of the German government).

Everyone is entitled to their opinion ... even when it's wrong :rofl:

There are, of course, people who are happy with running a Linux desktop, but relatively few. More on-topic, my comment really was intended to ensure that people reading the thread didn't think that Windows was a blocker or that it gets in the way of at least developing for Node-RED.

Also people should realise that it has a very feature rich Linux environment built right in as a lightweight VM for the odd occasion when you really do need something that Windows can't already cope with as in this example when you need to be able to access a Linux FS. Though I'll be honest and say that I haven't actually had the occasion to try that feature so I don't know its limitations. I do use WSL all the time though. Oddly I mostly use it for remote SSH sessions as for some reason starting WSL and its native SSH client seems to be faster than running Windows own native SSH client.

Uggh, this all worked - until - I went through palette manager and tried to update Bart B's SVG node. After trying they disappeared with error messages:

2020-12-16T20:34:50.680Z Install : node-red-contrib-ui-svg 2.1.1

2020-12-16T20:34:56.814Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production node-red-contrib-ui-svg@2.1.1
2020-12-16T20:35:12.046Z [err] npm WARN node-red-contrib-ui-led@0.3.3 requires a peer of node-red-dashboard@2.23.x but none is installed. You must install peer dependencies yourself.
2020-12-16T20:35:12.046Z [err] 
2020-12-16T20:35:12.120Z [err] npm
2020-12-16T20:35:12.121Z [err]  ERR! code EEXIST
2020-12-16T20:35:12.121Z [err] npm ERR! path /home/pi/.node-red/node_modules/js-beautify/node_modules/.bin/mkdirp
2020-12-16T20:35:12.166Z [err] npm 
2020-12-16T20:35:12.167Z [err] ERR! Refusing to delete /home/pi/.node-red/node_modules/js-beautify/node_modules/.bin/mkdirp: is outside /home/pi/.node-red/node_modules/js-beautify/node_modules/mkdirp and not a link
2020-12-16T20:35:12.167Z [err] npm ERR! File exists: /home/pi/.node-red/node_modules/js-beautify/node_modules/.bin/mkdirp
2020-12-16T20:35:12.167Z [err] npm
2020-12-16T20:35:12.167Z [err]  ERR! Remove the existing file and try again, or run npm
2020-12-16T20:35:12.167Z [err] npm ERR!
2020-12-16T20:35:12.167Z [err]  with --force to overwrite files recklessly.
2020-12-16T20:35:12.202Z [err] 
2020-12-16T20:35:12.203Z [err] npm ERR! A complete log of this run can be found in:
2020-12-16T20:35:12.203Z [err] npm ERR!     /home/pi/.npm/_logs/2020-12-16T20_35_12_180Z-debug.log
2020-12-16T20:35:12.223Z rc=1

Tried npm'ing them direct and got this:

pi@pigate:~ $ npm install node-red-contrib-ui-svg
npm WARN saveError ENOENT: no such file or directory, open '/home/pi/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/home/pi/package.json'
npm WARN pi No description
npm WARN pi No repository field.
npm WARN pi No README data
npm WARN pi No license field.

+ node-red-contrib-ui-svg@2.1.1
added 29 packages from 28 contributors and audited 29 packages in 6.524s

1 package is looking for funding
  run `npm fund` for details

found 0 vulnerabilities

Can't run without those nodes, so today I tried uninstalling and reinstalling N-R , still looks like there's a mismatch between file locations. Now, N-R will not run at all, I just get:

This site can’t be reached localhost refused to connect.
Try:

Checking the connection
Checking the proxy and the firewall
ERR_CONNECTION_REFUSED

Any ideas?

Russ

As per the docs - you need to be in your Node-RED user directory - usually ~/.node-red - before you manually install. So yes it installed - but not into the .node-red directory. When you reinstalled - did you use the script ? What did it report ?

OK, I'll try that. I tried upgrading the SVG node via "manage palette" but got errors, also got errors trying to remove some of the nodes "audit" had issues with. Only logging is in post #14. The SVG is my main concern, not so much removing the deadwood. Watson IOT comes to mind, there were several others.

I did use the script, and ran npm install from within the /.node-red folder the first time when all was good (Colin, post #2). Did so much stuff today trying to get the SVG back, I honestly don't remember. I think I somehow got folders/files in the wrong place.

I did do a complete "npm uninstall" & (script) install right before the browser quit seeing N-R...

Russ

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.