I have HAAS running on RP3 with a 64GB flash card on which everything is installed.
OS is on it, logs are on it, MySql database on it, etc…
So the card gets a LOT or writes. And my understanding that FlashCards are not really designed for lots of writes at the frequency it us used by HAAS.
So a couple of quetions:
Is running HAAS from a flash card a good idea to begin with? How long does the typical flash card lasts before it dies?
What do you use to create backup images of the card, just in case it dies?
What is the best software on Linux and Mac to make full bit-levl backup of the flash card so that in case it fails, it is easy to restore the current state. What are your configurations for such backup?
I guess one can shut down the Pi3 , take the card out and use tools to create an image from it. Is there also a way to mirror it without shutting down the HAAS over the network?
I saw some people boot from the network instead of the flash card. Can you share your configs and also discuss any disadvantages of running of the network boot?
What tools if any you use to monitor the health of the flash card to maybe alert yourself that the “end” is near and time to make a full backup/mirror copy?
Its difficult for anyone here to say what is typical, they can only go by their own experiences. I have been running on the same 8GB SD Card for 9 months without a problem. If you do all the things on the Pi website you should be fine.
As to backups, I keep my HA configuration offsite in git, and backup once a month (normally before an upgrade) by taking shutting the Pi down and taking a disk image of the SD card… I know others do a backup while running, but you only need to search the forum to find their suggestions.
There are many articles out there about Flash write wear-out
There are many more links you can find. I assume our flash in Pi is NON commercial grade, so it is probabbly 10,000 + writes. These cards typically used for photography and writes are not that frequent.
HAAS however, writes logs etc all the time. So I just want to hear if anybody had experience of the flash card failing after some time.
Yes, SD cards do wear out. But I am interested in seeing your reference for [quote=“B1tMaster, post:1, topic:20711”]
not really designed for lots of writes at the frequency it us used by HAAS
[/quote]
The quality of the SD card you use is entirely up to you.
Where did you get this figure from?
There are plenty of threads on the board about SD cards failing. Most of them seem to be caused by environmental failures such as poor power supply, incorrect shut down procedure etc, but there are enough people worried about it to use other forms of storage.
I’ve been through numerous SD cards, all different makes and sizes with HASS. All of them failed for me after the 1 month mark. I think I took all the necessary steps, excluding entities from the log etc that were not needed, however the problem persisted.
Since then I switched to running everything off of a USB, I’ve been going three months strong with nothing failing. this could just be all down to luck but I wont be using a SD card for the pi anytime soon.
Jesus multiple SD cards only lasting one month? What are you doing with HA? I have taken zero precautions ()aside from backups) and I’m going on one year just fine.
Yeah, some would be a little longer but it seems everything started around the one month mark. First SSH would start to fail, then SMB. Things would get worse from there until HASS vanishes.
I’m not doing anything crazy. I’ve got all the usual components, running some zwave sensors, proximity and location components and bunch of sensors for things like plex, sonarr, etc.
Since moving to USB though I’ve had 0 problems, still using the SD card to boot from though as it’s a RPI2.
FWIW, I’ve been running HASS on a Samsung 32GB Mini SD card for almost a year and a half without issues. I tend to buy the fastest, highest-rated cards I can find.
Instead of going into the SD card limit discussion, I’ll just answer point 2 above.
I simply use Git to do the backup. I do a backup of the whole card every three months or so, but it’s not really that needed. I do all coding locally on my Mac, push to GitHub and then pull from the RPI with a deploy key. That way, I will never lose any config on failure.
I do have a couple of other config files that are very seldomly changed, such as Tellstick config and Homebridge, those I just copy paste into a separate repo.
RPi3 supports boot from USB, I haven’t tried Resin, but pretty sure it will work. I’m going to give it a try in a week or so, because number or operations with Hassio is drastically higher than it was before.
I do have backed up everything and could probably restore current config in a matter of hour, but wan to try avoiding it anyway
Your best way of ruining SD cards is with interrupted power supply. They will wear out eventually just because of shear writes, but, you’ll easily corrupt your card if you’re writing during a power cut.
Easy solution? Build a UPS. I do this for each of the Pi’s doing home automation stuff, to limit their maintenance as they’re often in tricky places.
Get a USB power pack, make sure it’s not cheap. It needs to be able to handle charge protection (so you can leave it on charge forever. Cheaper one’s won’t handle this well), and it needs to be able to handle simultaneous charging of the battery and output charge to the Pi.
If you’re Pi’s are connected via Cat5/6, you’re sorted. If you detect the network crashes, assume there’s a power cut and gracefully shut the Pi down. There is even existing software to help you do this!
I have done this too and the whole system has been much more reliable. I’ve used Sandisk 16GB cards in the past and I’ve had corruption issues. The card will format and work OK again but in the last 18 months I’ve had 3 go bad so I won’t be using SD Cards again anytime soon. The Pi3 allows you to boot to USB thumb drives without a SD card even plugged in so I went this route with a 16GB Lexar USB drive.