Jump to content

Run Homeassistant on tinkerboard on SSD


metRo_

Recommended Posts

Hi,

 

Can I use this guide to run armbian on a SSD on a tinkerboard and then install Homeassistant? Until now I run hass.io.

 

I'm trying to run it on an SSD to prevent SD card corruption again.

 

Since HA will run on a docker, could I just run docker from SSD and keep armbian on sdcard?

 

Which option would you think is better?

 

Thank you

Link to comment
Share on other sites

I mean, you can do whatever you like.  :)

 

But I never had problems with my few boards with Armbian running on sdcard nor eMMC.  However I make sure I take care of all important details like buying only certain brand name sdcards, and only from known good suppliers (which no longer includes Amazon, IMO), checking them thoroughly upon arrival, using good power supplies, etc...

 

Basically everything in Getting Started section of docs.  Which I would hope you have read by now.  We wrote those for a reason, you know.  ;)

 

I never tried running from SSD, nor saw the benefit of that (and usually prefer to save my few available SATA / USB slots for hooking up storage drives) so I would be interested to hear anyone else who does that or thinks it's a good idea.  Now, I could be wrong, but my perception so far is that's not too common?

 

13 hours ago, metRo_ said:

Since HA will run on a docker, could I just run docker from SSD and keep armbian on sdcard?

 

By default, Docker will run as a service by the OS, storing it's images on whatever media that the OS is installed on (usually in /var/lib/docker).  Unless you were referring to the "volume" (persistent storage) for Docker being on your SSD.  Which would also work.  I don't know how much persistent storage HA needs, just some configs, right?  I wouldn't think a lot.

 

Anyway to answer your question, something like this (Armbian on scdard) seems like a much more "normal" option to me.  Where you want to put persistent storage for HA is up to you but in my mind it's just some config text files, so very small.  And therefore I wouldn't want to waste a whole drive just for that.  Unless you were talking about storage for your Docker images.

 

From your post, I suspect you had some problem with scdard corruption.  Armbian do a lot of things to mitigate this (like writing logs to zram, etc.) to minimize wear on your sdcard.  Maybe you know this already (and maybe this is why you decide to switch to Armbian) but if not, all of this info is also right there in the docs for you to study.

 

Having said that, sdcards do wear out after some number of years.  So keep spare sdcards (also good for troubleshooting), make backups of your important data, etc.  But these things always apply and are not particular to Armbian.

Edited by TRS-80
typo
Link to comment
Share on other sites

I read the docs and that's why I'm trying to understand if I should install the OS on the SSD or not.

 

2 hours ago, TRS-80 said:

I never tried running from SSD, nor saw the benefit of that (and usually prefer to save my few available SATA / USB slots for hooking up storage drives) so I would be interested to hear anyone else who does that or thinks it's a good idea.  Now, I could be wrong, but my perception so far is that's not too common?

People on HA forum, mostly run HA on RPi, says that running from SSD card is much faster than on SDCard, mainly, when loading history logs.

 

2 hours ago, TRS-80 said:

Anyway to answer your question, something like this (Armbian on scdard) seems like a much more "normal" option to me.  Where you want to put persistent storage for HA is up to you but in my mind it's just some config text files, so very small.  And therefore I wouldn't want to waste a whole drive just for that.  Unless you were talking about storage for your Docker images.

HA record a lot of logs (sensors, actions, etc). Maybe I try this for now, Armbian on sdcard and docker persistent storage on ssd.

 

2 hours ago, TRS-80 said:

From your post, I suspect you had some problem with scdard corruption.  Armbian do a lot of things to mitigate this (like writing logs to zram, etc.) to minimize wear on your sdcard.  Maybe you know this already (and maybe this is why you decide to switch to Armbian) but if not, all of this info is there is also right there in the docs for you to study.

Yes, I had a problem with an sdcard that dies after 3 months. I use HA OS and looks like they also implement some of the things you enumerated to minimize sdcard corruption.

 

Thank you

Link to comment
Share on other sites

Well, FWIW I just asked in IRC if ssd are faster than sdcard, and one person said "yes" so, take that for what it's worth.  From what you say though, it seems like there is also some consensus at HA forum about this.  And if that's the case, maybe you do want to run the OS on the ssd after all?

 

Running OS on ssd would be for performance reasons then, I suppose.  For what I do (light server type loads) I guess sdcard (or emmc) have been "good enough" for me, but maybe your use-case is different and maybe you benefit from that.

 

OTOH, there could be an argument made about whether you want to keep your OS and data separate.  This is something I do on many of my GNU/Linux systems, in general (/home on one drive or partition, and / (root, OS) on another).  This gives the advantage of being able to completely blow out the OS and start over from scratch, while not affecting your data.

 

So maybe this is is why you post.  To discuss this tradeoff.  If so, hopefully I give you some more things to think about.

 

I guess I learned something today.  Thinking further, maybe the reason sdcard are more common is not because they are faster but rather that they are cheaper.  :D

 

Let us know how it works out.

Link to comment
Share on other sites

15 hours ago, metRo_ said:

Hi,

 

Can I use this guide to run armbian on a SSD on a tinkerboard and then install Homeassistant? Until now I run hass.io.

 

I'm trying to run it on an SSD to prevent SD card corruption again.

 

Since HA will run on a docker, could I just run docker from SSD and keep armbian on sdcard?

 

Which option would you think is better

 

Thank you

 

Yep. I run homeassistant on my armbian devices via docker.  I just use the homeassistant/home-assistant image

 

re: storage.   If you are using local storage for storing your history data.  I would use an SSD device.  It's a lot of writing.   If you're storing them remotely in mysql or something, sdcard is probably fine.  https://www.home-assistant.io/integrations/recorder/


My recommendation is just stick with booting from sdcard, and setup your SSD as storage for /var/lib/docker.   I recommend BTRFS with docker.  Here's an example of my fstab where i'm using a BTRFS subvolume on an external SSD.

Easiest thing to do is just mkdir -p /var/lib/docker and mount it before you even apt install docker.io   but not end of world oherwise

 

Link to comment
Share on other sites

8 hours ago, lanefu said:

Yep. I run homeassistant on my armbian devices via docker.  I just use the homeassistant/home-assistant image

 

Did you use armbian-config to install HA?

 

8 hours ago, lanefu said:

re: storage.   If you are using local storage for storing your history data.  I would use an SSD device.  It's a lot of writing.   If you're storing them remotely in mysql or something, sdcard is probably fine.  https://www.home-assistant.io/integrations/recorder/

 

I use mysql but locally on the device.

 

8 hours ago, lanefu said:

My recommendation is just stick with booting from sdcard, and setup your SSD as storage for /var/lib/docker.   I recommend BTRFS with docker.  Here's an example of my fstab where i'm using a BTRFS subvolume on an external SSD.

 

Did you forgot to show the example?

 

By mount /var/lib/docker on SSD will docker(all HA related things like mysql) write only on SSD?

 

Thank you

Link to comment
Share on other sites

4 hours ago, metRo_ said:

Did you use armbian-config to install HA?

No.   I'm saying apt-install docker.io.  and then setting up homeassistant via their homeassistant/home-assistant container

 

4 hours ago, metRo_ said:

Did you forgot to show the example?


yes sorry.    

UUID=6678065c-8e6d-453f-b3c6-58d4342453a4       /var/lib/docker  btrfs   defaults,ssd,subvol=docker                             0       2

 

4 hours ago, metRo_ said:

By mount /var/lib/docker on SSD will docker(all HA related things like mysql) write only on SSD?


Ah yes, that's. good point..  yeah you might want to make 2 sub volumes, 1 for docker, and another for your persistent data for the containers.

Link to comment
Share on other sites

4 hours ago, lanefu said:

Ah yes, that's. good point..  yeah you might want to make 2 sub volumes, 1 for docker, and another for your persistent data for the containers.

By sub volume do you mean a partition, right?

 

I'm familiar with docker concept and how to run it etc however my knowledge about it is basic. Would you mind to elaborate a little why do I need two sub volumes? What is going to be write on the persistent data? MySQL DB will be on persistent data or on the other volume?

 

PS: Where do you store your data? External db?

 

Thank you

Link to comment
Share on other sites

I think most of Armbian specific questions have been answered.  These are now general Docker/HA questions.  So, lanefu may or may not reply (up to him), but I think you should have enough now to go figure it out on your own.  Study Docker documentation, maybe ask at HA forums, etc.

 

I do have a separate thread going where I like to talk about containers in general.  I plan to post a link to a very good basic Docker article I came across recently, as I am just starting out on Docker as well.  My other thread is: Self-hosting micro- (or regular) services, containers, homelab, etc.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines