"Bricked" Pi4 after OTA update tonight - way forward?

Here I was, clicking happily on several add-on updates which popped up in my RPi4 run HASSOS tonight. Everything worked flawlesly so I didn’t bat an eyelash when OS update popped up as well and confirmed it. Two hours later, RPi rebooted itself and does “something”, I can’t even SSH into it, it never appeared back in DHCP list.
Hey, I know I was being exceptionally stupid not even creating a snapshot before update but that’s what it is.
I didn’t touch anything since then basically, didn’t even do the power cycle because I don’t want to corrupt the SD card.
RPi4 is two days old, so is the card I boot from. Supposedly high quality card. Nothing else connected, just few addons, no automations or anything fancy. I was just beginning. But enough to be a pain to set up yet again (I just finished transition from RPi2 which was far from flawless). I have an older snapshot, of course, and I am sure I can recover it from the card, re-install HASSOS and go from there but that’s gonna be yet another evening in dad’s busy schedule wasted.
Isn’t there anything easier and faster I could do at the moment?

1 Like

Wel lI was going to suggest this but then realized if it’s not even getting to the point where it gets assigned a local IP address then that won’t help much.

If you take out the sdcard do you have another machine you can read it on as a drive in its current format? Could at least pull the config directory off that way so you don’t have to start all the way over. Not sure how to save add-ons that way though if you put a lot of work into configuring those.

Connect to monitor, read messages on screen…

2 Likes

Considering I don’t even own the danged micro HDMI cable, that’s far from easy, unfortunately. I’ll try to get one on my way from work today, though.

If I recall correctly, you should be able to copy the “data” partition contents and basically move that into a new install if you really need to.
Basically like @CentralCommand says, plug SD card into another machine. Copy contents to… preferably another ext4 partition, or a disk image? If you have a spare SD card your could just DD the entire installation over to the spare, to be safe.
Reimage HAOS to the SD card you mean to use primarily, then pop it in the Pi and let it do it’s normal behind the scenes setup, so the new data partition expands to fit your whole SD card. Once you can visit the setup webpage you should be good to power it off again.
Connect SD back to other computer, and copy the data partition onto the main SD card again.

As long as the cause of it failing to boot (or launch the web server, whatever point it is hanging) is in one of the OS partitions, then this should work fine, but if the issue is in the config, or the whole data partition is unreadable, then this won’t help much…

Good luck!!! :crossed_fingers::crossed_fingers::crossed_fingers:

Let me translate it to myself to a language I might understand: you’re suggesting to image that partition which isn’t normally visible when plugged into a Windows machine and flash it back after doing a clean install of HASSOS?
What of the config files then? SSL keys, custom components and all the stuff which is on the other partition?
Sorry if I’m being particularly thick, I didn’t sleep that much last night, waiting for my HA to raise from the dead.

Connect the SD card to your PC.

You will need software capable of reading Linux partitions if using a Windwos PC. DiskInternals Linux Reader is available free.

Find the /config folder on the SD card. There are posts about this on the froum, use the forum search function.

Copy everything in your /config folder, including the hidden .storage directory and files.

Paste this copied data into a new install. With the exception of config/home-assistant_v2.db. Delete this. It never survives the transplant. You will lose your history data.

Restart Home Assistant.

Set up automated snapshots:

To a NAS: Samba Backup: Create and store snapshots on a Samba share

To Goggle Drive: Add-on: Home Assistant Google Drive Backup

To DropBox: Hass.io Add-on: Upload hassio snapshots to Dropbox

To NextCloud or S3: [New Addon] Snap-Shipper - Webdav and S3 backups (and probably other ways to later on)

1 Like

OK, what I just said was actually kinda stupid, I forgot I had Samba set up. So I mixed up the partitions.
Simply copying config isn’t a problem at all. With that I should get everything back? And what exactly is history data? I mean, e.g. influx db contents should transfer, right?

Goog point about automated snapshots. Probably wouln’t help much in this case though, as I literally finished with setting up one minute and went on to updating the next.

Yes, everything except your history data and addons.

Influx and all your addons will be gone.

Nope. But it will next time. Hopefully.

If you have SAMBA access open the Log and lets see if we can fix what’s wrong instead.

config/home-assistant.log

Nope. But it will next time. Hopefully.

If you have SAMBA access open the Log and lets see if we can fix what’s wrong instead.

config/home-assistant.log

I had, I don’t have anymore (as the machine doesn’t connect to the network). But when I eventually turn off the Pi, I can easily pull the log from the SD card anyway, can’t I?

Right, so what I will have to do is to install the add-ons again and configure them.
Funny enough, that is exactly the situation I ended up in when I migrated from RPi2 to RPi4 the other day. That and setting the dashboards again. Not cool. My fault, though.

You sure you don’t have any snapshots on the card?

Of course I do. But like I said: I did most of the setting up and immediately went for the update. The last snapshot reflects situation immediately before I did most of the work :unamused:

I believe so. There are a couple logs that are lost on reboot, but it might be when you’re starting up again that HAOS resets them, so they could still be there initially :crossed_fingers:

I don’t suppose you were able to get a hold of a hdmi cable so you could watch it’s startup on a monitor either by chance?
If startup gets far enough before stopping, you might also be log in as the root user and actually inspect the state of the OS too

I am working on it just now. I couldn’t get hold of the cable (those pandemic restrictions). I just plugged it out, checked the log (nothing interesting), backed up config folder and my older snapshots and now I keeping my fingers crossed for it to actually boot after the snapshot restore. Seems like no luck so far, strange.

Anyway, thanks to you and the other guys for their suggestions what could I do. It kinda boiled down to “man up and do it again” :slight_smile:

Second HASSOS update fast and faultless :face_with_raised_eyebrow:

1 Like

Ah, sorry to hear that. If it weren’t for those restrictions we might have been able to find out what happened and fix it :sob:

Spock - COVID