Possible to move database to USB on HassOS/Hassio?

Hi,

I’ve been reading some posts about it being smart to move your database and logs to a USB drive instead of loading this on the SD card. I’ve been having some problems with cards earlier, so I think it makes sense. However, I also read there were issues on moving this using HassOS/Hassio. Is this true? If not, what is the best tutorial to follow to do this?

Also, I’ve been thinking it might make sense to just run the Pi with an SSD instead of cards and USB. Any experience on this? And is there any ok cabinets to recommend to hold both a pi and a drive that doesn’t cost a fortune?

Thanks
TJ

There is work underway to support SSD for HassOS, but no date for when it will be available yet.

https://github.com/home-assistant/hassos/issues/164

To understand this, does it mean they want to implement first a function to move the database and then eventually boot the entire system from an external disk?

Can’t say about the hass.io functionality yet but if you want to prepare (assuming you will be using an x820 type SSD board), you may want to look into this:
https://www.amazon.com/Geekworm-Raspberry-Storage-Matching-Enclosure/dp/B07GRZRW7J/ref=sr_1_3?ie=UTF8&qid=1539347168&sr=8-3&keywords=raspberry+pi+ssd+case

That has to be the most horrendous use of a USB bridge board I think I have ever seen, intentionally exposing the power and data pins of USB externally like that, using them internal to a case is one thing but externally :disappointed:

1 Like

See here:
https://github.com/home-assistant/hassos/issues/214

Data offloading may be in release 3 by the end of the year.
If you want a board with a SSD look at the Odroid C2 which is supported with HassOS 2.2 or the Asus Tinker Board S which will be supported with release 3.

1 Like

Hi,
Thanks for the update. Is this the only way to use a USB with hassio, to wait? I want to move the database only just now…

You can move everything.

2 Likes

Well, being the question was for not expensive, I guess not being NASA approved will be okay.

Everyone makes mistakes, even NASA but as @allan said, that’s dumb. It’s dangerous to devices and lazy engineering. Put a few blobs of conformal coating on it at least.

Though I suppose it’s easy enough to fix with a small amount of play-dough experience and some Sugru or (open source!) Ooogoo.

1 Like

I’m confused, it says only possible with resin os and not HassOs?

This is correct. Where’s the confusion?

If you have a NAS, you can configure the recorder to save to a database on that:

That is what I use

Because all Hassio images today are built on HassOS and not Resin anymore… So I wasn’t sure if you had managed to get it working on a HassOS build… In other words, I can’t move everything as I understand it…

I’ve just seen your post about configuring recorder to use a NAS. I would like to do this for my hassio setup. I’ve read through the recorder component and I’m still none the wiser as to exactly what the config should look like. Are you able to share yours as an example?

Mine looks like this:

recorder:
  db_url: mysql://homeassistant:[email protected]/homeassistant?charset=utf8
  exclude:
    domains:
      - input_select
      - automation
      - cover
      - camera
      - group
      - weather

The xxxxxxx is the password and homeassistant is the user.
At the bottom the documentationpage are examples of the URL under “Custom database engines”

My config is the second MySQL option:
mysql://user:password@SERVER_IP/DB_NAME?charset=utf8

As you can see I also excluded some domains, those are not recorded,

2 Likes

Just wondering - this won’t move the db to a USB stick will it? It’ll be on the SD card still within the homeassistant folder?

If you use the mysql recorder, there will be no database anywhere on disk

The question remains…
Can one move the database in Hassio to a USB drive connected to the Raspberry Pi?

7 Likes

Any news on this? I’m also looking to move my MariaDB databases to a USB drive connected to the Pi running HassOS

1 Like