First off, I have seen a lot of questions/answers talking about the rainbow screen. However everywhere I looked the issue only seems to occur on the first time the system is booted.
In my case it's different. I have a pi-hole setup on my raspberry pi 3 b+. OS is Raspbian Stretch Lite.
I have used it for months without any issues and during this time updated the pi-hole (
pihole -up) and the system (
sudo apt-get update and
upgrade) multiple times.
Today I saw that there was a new update (v4.2.2) for the pi-hole in the webinterface. I logged into an ssh session with the pi and executed the update command for pihole. Weirdly it got stuck and wouldn't update while fetching some data from the internet.
I then though okay I'll just update the other stuff first. Executed
sudo apt-get update and there was the following error "failed to exec method /usr/lib/apt/methods/http". Searching for that lead me here where there is a first mention to repairing the filesystem.
Since I didn't want to do execute commands I know nothing about right away, I simply restarted the pi.
After rebooting I got the rainbow screen.
Most of the answers I found about that were "you installed an old image, you'll need to flash a newer one" and there often is a link on how to flash your sd-card. But I already did all of that months ago and had no issues until now.
Another idea I often saw was "you're not using the right power supply" but I'm using the official one which, once again, has worked for months.
There (here in fact) was also a suggestion to add
boot_delay=1 to the config-file. I did this and it didn't help.
Now what I need is a way to fix this without loosing the data I currently have on the pi.
In the same question as mentionend before there's also this:
..However if the coloured screen remains, it suggests the kernel.img file is failing to boot. Try replacing it with a known good one.
Since I'm not very experienced with Raspis and linux itself, I don't know what this would do.
I know I can get the kernel.img if I open the current raspian img with 7zip and inside that open 0.fat. This seems to be the fat partition which gets mountet if you plug the sd-card into windows. In there you could extract kernel.img but I don't know if that's the right way and I also don't know if there are any consequences of simply deleting the old one and replacing it with the new one.
Does anyone have an idea on how to fix this without loosing the data on the pi?
Edit (some additional information):
There is are two status-leds and one is ACT-led (read from here).
The ACT-led signals if there is SD-card activity. In the first ~7 seconds this led is lit up green. After that the led shuts off entirely. I don't what this means and if it's supposed to happen but maybe it helps answering the question.
I've read some more about the act-led (mostly here) and it seems like the led is supposed to blink for a while. In my case it blinks once right at the start before just being lit. I assume this means the raspberry pi isn't able to read from the card.
What could be the cause of this and how do I fix it (other than reinstalling)?