Installing Home Assistant on a RPi 4b with SSD boot

The trick I have been using is not to restore the snapshot straightaway; instead create a new user and upload your snapshot using the Supervisor/Snapshots command.

I tried it both ways, and both did not complete the restore after waiting overnight.

Should not take that long. Restoring to an SSD should be fast. When you made your snapshot did you stop your DB?

I did not stop my db. Did I miss a step in the instructions?

Not in the instructions, but it gets corrupted easily. If you use the mariadb add on it is easy to stop.

OK.

I do not have the MariaDB add-on. I guess I am using the “default” db. How can I stop that?

PS Thanks. I think we’re onto something.

The easiest solution is that you exclude the DB from the snapshot when you create it. You will only lose the history of the last 10 days. Within the next 10 days it will gradually build up again.

I personally exclude the DB from all of my snapshots. Having my history set to include 30 days it would only bloat the snapshots without any real benefit.

If you restore a snapshot without a DB an empty DB will be created automatically for you.

Hi Jörg.

Sounds good. What do I turn off?

Thanks,
SB

Did anyone successfully update to HASSOS 5.12?

Yes, I have updated HassOS 5.12 since the beginning of the release and no problem.

5.12 working flawlessly here too.

SSD - https://www.amazon.co.uk/gp/product/B07G3KRZBX/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1

Adapter - https://www.amazon.co.uk/gp/product/B01N2JIQR7/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1

My SSD wasn’t on any of the lists but was working well…or so I thought. Installation, booting and performance were all good with no sign of issues. However, I cant access my supervisor panel on HomeAssistantOS. It popped up with the message below

image

Is there anyway to confirm that the SSD, adapter or combination of both is the culprit? Can i get logs form somewhere that confirm there is an issue?

I want to cinfrim it is an issue before ordering StarTech 2.5″ SATA to USB 3.1 Adapter

The trick I use is to have HA store its database on a share that I exclude from the snapshots. I use the Media share for that purpose. In my case it contains only audio and videos files that I do not want to include in the backups anyway.

Here is a config example to have HA store the database in the Media share instead of in /config:

recorder:
  db_url: sqlite:////media/HA/DB/home-assistant_v2.db

You then just deselect “Media” when creating a snapshot.

Make sure your Zigbee USB stick is physically moved away from the RPi via a USB extension cable. The RF noise generated via the USB3.0 attached SSD will prevent the Zigbee radio from working properly.

Thanks again Jörg.

I tried this (with various values) and keep getting config errors. Do I have to “touch” the new db file before rebooting?

Or should I copy/move the original db file there? (And if so, how do I turn off the recorder first?)

Thx.

Yeah its on a 1 meter extension. Its really strange HA Core works (automations, can switch tasmota lights) but supervisor stuff doesn’t (frigate down, zigbee2mqtt down, cant putty into Rpi)

very odd behaviour

1 Like

OK, that did it!

Rough instructions:

  1. go to Supervisor -> Add-on Store and install “Terminal & SSH” add-on
  2. go to Supervisor -> Add-on Store and install “File editor” add-on
  3. run the terminal and enter:
    cd media
    touch home-assistant_v2.db
    
  4. run the file editor and edit “configuration.yaml”
  5. create or add the following:
    recorder:
      db_url: sqlite:////media/home-assistant_v2.db
    
  6. save the file
  7. go to Supervisor -> System and reboot the host
  8. when HA is back up, run the terminal and enter:
    cd media
    rm home-assistant_v2.db.corrupt.<whatever your date looks like>
    cd ../config
    rm home-assistant_v2.db
    
  9. go to Supervisor -> Snapshots, select Type: Partial snapshot, and click CREATE
  10. click on your new available snapshot and download it

Hi there,

Thank you so much for that one :slight_smile: I’ve tried to boot hassio from a SSD with two distinct physical connectors, none worked (some combination did work with raspian - but never with hassio :/).

I’ve just moved my data to the SSD and… My HASS is back, with a really low load average (was beetween 7 and 9 before that).
I do not understand why I’ve never seen that documentation before… Not sure the swap has also been moved, but it should also move to the SSD (I’ve a 2Gio RAM rpi4, swap is often used).

Well, normally it should not be necessary to create a fake DB file. HA creates it on the fly during startup if it does not exist.

If you have installed “terminal and ssh” you can also use nano to edit files in terminal window and you can use `ha core stop’ to stop HA.

This should work (untested!):

nano /config/configuration,yaml
ha core stop
mv /config/home-assistant_v2.db /media/
ha core start

BTW: I recommend ‘SSH and Web Terminal’ by Frenck. It can do much more than ‘Terminal and SSH’.

1 Like

Any help would really be appreciated! When it works its lightning fast so I don’t want to give up. Supervisor becomes inaccessible and therefore HA basically stops working. Although Lovelace seems unaffected and I can switch Tasmota devices so Mosquito addon still seems to be running??.

Steps Taken Without Success
ha supervisor repair
ha core rebuild
moved to StarTech 2.5″ SATA to USB 3.1 Adapter
Tried Ugreen powered adapter
attempted EEPROm SD Recovery and guide methods

Screenshot of monitor plugged into HA