Home Assistant Community

Save DB on USB stick/drive (Hassio)

#1

Hey guys,
I know this has been discussed around the forums but I’m having a hard time finding the right resource and setting it up.
Basically, I can see my drive in the system-> hardware window. (i have /dev/sda1 and /dev/sda under disk: )
Could someone tell me what i shoudl enter as db_url: in my configuration.yaml to get hassio to move the DB there?
Or am I thinking this completely wrong? :smile:

#2

Did you ever figure this out? I’m facing the same issue; as in, lack of clear solutions. There’s a lot of talk of “excessive DB use will burn out your SD card, you should move it to another location” but very little “here’s how it’s done.”

#3

this is the write up.

#4

Unless I’m missing something; that doesn’t look applicable to a HASS.IO install?

#5

perhaps. It was written for Hassbian I think

#6

I ended up moving the DB to the amazon free RDS service, didnt look into local db any more :slight_smile:

2 Likes
#7

can you provide a little how to ?

#8

Sure, just give me some time to write it up.

#9

great, how is the performance overall ?

#10

to be honest, I dont use extensive history data, for graphs and stuff, just some motion detectors i want to see if they were triggered and some things i need their state saved during restarts. It’s working like the local db in my case, havent seen any problem.

1 Like
#11

Looking forward to the How-to.

#12

I won’t have the time to do it anytime soon I’m afraid, I’m at work.
Maybe the reddit thread that helped me can help you out meanwhile https://www.reddit.com/r/homeassistant/comments/a1xf3q/-/eatkplm

1 Like
#13

Hi. Has somebody been able to use the nuw feature that moves the database to ssd/usb drive?

labelin the partition on ssd with hassos-data and renamig the one from sd card does not seem to work.
I renamed it in gparted.

Do someone knows how this feature actually works, if at all in hassio?

#14

if you ust can share your recorder config, I have already created db in Amazon rds which was not so difficult

#15

Sorry, was on mobile and it seems like cloud9 is officially non-mobile friendly, here’s my recorder config:

recorder:

  db_url: mysql://user:[email protected]:port/dbname?charset=utf8

You can get the URL and port from the endpoint section in your rds console, RDS> Databases> dbname:
image

Also, since i dont have a static ISP ip, i had to leave the inbound/outbound security groups open. I know it’s not safe but i have not figured out how to fix this. Let me know if you know a solution to that :slight_smile:

#16

Thank you, I’ll check later this week.

Looking on the web I found the below url which you could use to protect your connection. I have not tried it.

#17

Looks like exactly what i need, will check it out too. Thanks man!

#18

So does anyone have any news on this? The second SD card in 5 months just died on me and I need to change smth. because this just isn’t acceptable.

#19

Have not found something yet.
And i think that this option is very important.
If we could move DB and Logs to a usb stick, we would have minimal usage of the sd card.
And if the stick went bad you could just switch it out for a new one and keep running in seconds.
I’m guessing it’s some foundamental hassos issue that wont allow it? idk

#20

Didn’t find any solution yet. This is the last reason who keep me on using previous hass.io version. I have a mini SSD plugged on my Raspberry Pi.