What the heck: why doesn't home assistant use usb drives?

My what the heck for a long time: using usb drives easily inside home assistant.
Dying SD-cards of RasPis is a long time discussed issue here. While it’s working okay for me with better cards, I’m very concerned about it dying.

However, there is no option of putting parts of the System on an SD card on my raspberry pi3 via thts reliably working. Getting usb drives available to home assistant to write files to and/or having an easy way of installing it to usb would be great.

What I want the most: option to put the database (for history and so on) on an USB drive.

But you can.

Then please point me to an easy solution that let me move my database to an usb drive on Home Assistant (former Hass.io)

https://www.cribbstechnologies.com/index.php/home-assistant/moving-home-assistant-logs/

edit: frenck says no :slight_smile:

Thanks! Gonna try that out! In none of the threads in here this was pointed out.
What I’m still wondering: this really works with home assistant? (hass.io)

I think so, but there is one way to find out.

Why not just boot the whole system off usb?

Because I didn’t find a solution that doesn’t:
- Requires using the development build
- require a raspberry pi 4
- use the supervised install - that’s no longer officially supported

That’s what I wanted to say: maybe there is a way (or even 10 ways) but they are complicated. It should be: plug in your usb, get it recognized by Hass.io, go to settings and move database to usb. (I’d be okay changing the path via yaml, but UI would be nicer if we start changing things)

Please, do not use that method :point_up:, you might get into trouble later on.

However, that said, the Home Assistant Operating System does have support for things like this.

You can actually move your data over to an external harddrive using the datactl command. E.g.,

datactl move /dev/xxx

(you need to be patient after the first reboot, but it will work :wink:)

2 Likes

I must say that this is the first time I have seen this! Thank you.

The supervised install is officially supported.

@frenck: Thanks for your input!
Had time to try it out today. How can I check if it really worked?
Tried to plug out the usb-drive and booting and HA still booted up. What can I do to see logs while moving the data to see what went wrong?

hi @frenck I’ve done the datactl move /dev/sdb action and confirmed with yes. my HA has been rebooted and works fine. how can i see that data have been transfered ? in System Metrics, Used space has not changed. Thanks for your support and great tool

If you are still wondering: you can use

systemctl status mnt-data.mount

It should say that it’s enabled and which drive was mounted.