0

I've seen a lot of questions like mine, but then the problem description is different, and so were the responses....

I installed a 3.5 inch LCD display, downloaded and installed the wrong drivers, so I then downloaded and installed the correct drivers, and the display worked perfectly ... until I touched it (touch screen) and a large spark fried the display. Now, I need to get back to my very-much-larger than 480x320 display, however ... Since I installed twice and the install does not bother with restoring a backup, just creating one, my backup was of the wrong installation, leaving me with no backup.

I have stepped through the backup/restore scripts and tried to reverse everything, however, I did not, or could not, recover completely. Apparently, something(s) got replaced and lost.

The RPi boots, the display comes up in the larger resolution, however, every program now takes 10-15 seconds to start up. Rather than hunting down the problem, I'd like to know if there is a way to reinstall Raspian without wiping out my stuff. Basically, this would look like system update to a new version, but it would be to the same version.

uname -a: Linux 5.15.84-v7+ #1613 SMP Thu Jan 5 11:59:48 GMT 2023 armv71 GNU/Linux

user3481644
  • 117
  • 6
  • 1
    Do you want it so that all your stuff you installed is still there? Because you could just copy the files you want to keep and put it back when you reinstall Raspian. – LilData777 Feb 21 '23 at 14:46
  • @Friendlygabe777, true, but there is all of the configuration that I've done in /etc, etc. (pun intended), and not knowing what every installation has installed, removed, tweaked. – user3481644 Feb 22 '23 at 12:49
  • ok, you did first check task manager/check the cpu/memory usage, correct? That could be slowing down the raspberry pi. You can see what you installed that caused this to happen. – LilData777 Feb 22 '23 at 13:40
  • 1
    Just do what the experienced users would do. Restore from your most recent working backup (preferably to a new SD Card) or do a fresh install. Learn from your experience and ensure you ALWAYS have a backup. I always keep at least 3 backups for each of my multiple OS. – Milliways Feb 23 '23 at 09:37
  • 1
    It is easier (and certainly more reliable) to reinstall rather than attempt to repair. It is invariably faster - after all you can do a fresh install in a few hours. – Milliways Feb 23 '23 at 09:39
  • I agree with @Milliways I always just reinstall when I get a fatal problem and I always just reinstall all the programs. If you don't want to always reinstall stuff, try what I'm attempting and make a script that has all the commands to reinstall everything you want. Just make sure to backup that script. – LilData777 Feb 23 '23 at 12:25
  • @Milliways - I mentioned that the backup was over-written. I have used systems in the past that have a "recovery" or "re-install" option in which drivers, executables, etc., are re-installed for the current version, leaving configuration files in place. – user3481644 Feb 26 '23 at 16:44
  • If you have 1 "backup" you ACTUALLY have a false sense of security. 2 is better but 3 is the recommended practice. Overwriting a single backup risks losing everything. – Milliways Feb 26 '23 at 22:24
  • @Friendlygabe777 I did check for activity, everything was less than 5%, usually 0%. – user3481644 Feb 27 '23 at 11:34
  • @Milliways - The backup I relied on was the one the driver install created. I mistakenly presumed the install script would check for a backup and prompt for permission to over-write. I was wr... wr... wro ... wrong(!) As for creating these backups, a process I endorse, are you suggesting that I keep 3 backups of the entire system "disk"? How do you do that? The dd program? Do you tell it not to copy /dev/mem and then how is /dev/mem restored? I'm not arguing, just looking for the best practice for this platform since there does not seem to be a reinstall option. – user3481644 Feb 27 '23 at 11:40
  • I use a custom procedure - see https://raspberrypi.stackexchange.com/a/103991/8697 which generates a small customised image which can be installed by any of the normal installers . Since then I have modified my procedure for my own situation due to changes in Raspberry Pi OS , see the links Seamus has posted for other related processes which are similar. dd is a poor backup procedure as it generates large files which can only be restored to identical or larger SD Cards although I initially used it. – Milliways Feb 27 '23 at 12:12
  • See https://raspberrypi.stackexchange.com/a/103991/8697 for a discussion on backup, most of which is still relevant. – Milliways Feb 27 '23 at 12:15

2 Answers2

0

I'd like to know if there is a way to reinstall Raspian without wiping out my stuff.

This strikes me as an ambiguous question, but without knowing exactly what "my stuff" is, this may be an answer to your question:

You can use image-utils to make a backup of your system. This backup is made to an image file which can be easily restored to an SD card. It takes typically, 2 - 5 minutes to update an image, and slightly longer if you're creating a fresh, from scratch, image. It's done from a script that relies largely on rsync, and so it's not a "big deal" to download it, and you can run it while your system is operating.

For example, let's say you are about to undertake some system changes that you're not quite sure about, you could proceed as follows:

  1. Update your backup (2-5 minutes)
  2. Make all changes needed to your system & test
  3. When you're confident your changes are sound, create a new/from-scratch backup using image-utils (approx a 3-10 minute process), and save that under a different file name; e.g. "post-touchscreen-update".

image-utils gives you two simple ways to make a full system backup:

  1. From scratch:
$ sudo image-utils

you go through a brief Q&A to let the program know if you want to add

additional space to the image for changes. Very simple.

  1. To update an image previously created:
$ sudo image-utils /path/to/image-to- be-updated

no questions, simply update the image with the changed files

And so, had you done this before you made your changes, you would have an exact image of your system before you did whatever you did that caused it to malfunction. You could restore from that *.img file using one of several available tools that can write an .img file to anSD card (e.g. Balena Etcher for Mac, rufus for Windoze). If you practice this as a routine (e.g. set it up as a cron job), you'll always have a safe harbor to restore from.

Seamus
  • 21,900
  • 3
  • 33
  • 70
  • In my original post, I mentioned that the second driver install over-wrote the backup. What's done is done, I'm looking for another recovery method. – user3481644 Feb 26 '23 at 16:42
0

My original question is "I'd like to know if there is a way to reinstall Raspian without wiping out my stuff." albeit buried. "My stuff" is all of the configuration and custom installs I performed. The comments and answer all have essentially the same answer: "No".

The responses say that I should have had backups to restore from, should have done this, should have done that, etc. All good to know, and I did believe the software I was installing had a sufficient backup system, we know how that is (now).

Fortunately, I was able to stomp through the process and undo everything that was changed without any reinstall.

user3481644
  • 117
  • 6