How long should a good micro sd card last?

How long should I expect a micro sd card to last in the Hassio / Home Assistant environment? I am using Sandisk Ultra and Extreme cards.

If you are worried, best is to use an external database. History read/write is the greatest wear on the card.

I would like to try that, but my old nas is not that good and no way would I try to do that to a cloud service. I do not have nailed up systems in my house, just an old DNS-321. Can I use a USB hard disk, SSD or thumbdrive for the database?

What I do is that I have 2 SD cards on-hand.
When I am ready for an update of HA, I pull the card thatā€™s in my Pi and make a backup copy using ApplePi Baker (or any other image software that you want to use)
I then take the card that I have on ā€œstand-byā€ and burn that image on it. Insert it in my Pi, boot up and do my update.

With this I accomplish 2 things, 1) less wear and tear on your SD card. 2) if I mess up with my update or something breaks, I have my last known working configuration ready to insert and boot from, no waiting.
So every update, I just Flip-Flop my cards
Hope that helps

2 Likes

I am a windows houseā€¦ I did not think a complete card could be backed upā€¦

It canā€™t with Hassio so far as I am aware.

Just keep a snapshot and if worse comes to worse, setup a new system and restore your latest snapshot. I have an automation to run the snapshot backup everyday at 3am and to run the Dropbox add in at 4am so i have plenty of snapshots which are effectively full backups.

I also donā€™t think you can move the database to a USB if you are using hassio.

If you are using those sandisk cards you might be in trouble lol!

Have been good to me for many years in photo and video. Suggested cards?

Just a hint: The Raspberry 3 can boot and run from a USB stick. I donā€˜t have an SD card in use and more ā€¦

Indeed. I setup a USB to do this but donā€™t run it that way because there really seems to be no point. Why do you think a USB stick is more robust than an SD-Card? Both use the same technology I think. I asked this question on the hassio USB thread and didnā€™t get any real answers.

Regards SD-Card? I use a samsung evo plus 32gb and since I switched to that I have not had one crash of home assistant even though I was using a ā€˜goodā€™ card - and it tested 100%. All I know is they are not all the same.

I do not think a usb stick is better, but a usb SSD or small hard disk would be better. But, not sure I can install and boot from a usb drive.

My SD card has been running HA on my pi for 18 Months without a problem. I think I pulled it from an old phone.

Some people experience problems with sd cards, but most do not. It is sensible to give the SD a try and only worry about it if you have a problem.

Make sure to check the troubleshooting guide from the Pi website. An adequate power supply and proper shutdown procedures seem to be the most important.

Well you can if you want to. Thereā€™s pretty good instructions in the hassio forum and I did a blog post with screenshots here as well filling in some of the gaps in the instructions.

I was originally using a ā€˜noobsā€™ preinstalled card from the RPi Foundation and I was finding every couple of days my home assistant would completely lock up and need a hard-reboot as I could not restart it from the frontend or ssh. Also using an RPi power supply. When I changed to the Samsung EVO card, I have not had a single instance of this and have never been unable to restart via frontend or ssh. Weird thing is that the noobs card tested perfectly in the HWTEST program but it was definitely the card causing the faults.

Thereā€™s a really good thread on Whirlpool about Xiaomi specifically but also discusses sd-cards.

The biggest threat to the SD Card is the power outage. If you donā€™t have frequent power outages, and do minimal writes they can last years. Iā€™m replacing an SD card every year or so, because I get very frequent power outages and eventually they destroy the SD Card

Does the underlying os use wear leveling? If so the bigger the SD card the better (youā€™re not writing to the same bits as often).

Itā€™s just a personal experience that USB sticks are substantially more robust than SD cards. I use SD for photography, so they are formatted, filled up, read out and formatted again. USB sticks seem to be designed for more frequent writes. Besides: Because of their size and the port design they are much easier to handle.

But thatā€™s my very subjective opinion.

I understand however I think you will find the actual chip inside them is the exact same type of flash memory. I acknowledge there is a perception that the USB is more robust but it seems to me to be like trying to nail down jello. Every one thinks/says it but itā€™s a preference with no real evidence to support it.

Nothing at all wrong with having a personal preference.

The weak point is having a good power supply and a quality SD card IMO. Get that right and you will have very little problems.

If youā€™re not on Hassio then itā€™s easy - thatā€™s what Iā€™ve done. A good card should then last at least a couple of years, possibly longer. Iā€™ve killed one SD card on a Pi3, through two years of heavy writes on a Plex server.

Similarly you can use rpi-clone to live image a non-Hassio install.

How would you best use rpi-clone? From a cron job? that looks interesting, if you are running it that way, would you be able to share your cron job entry?

I run rpi-clone manually, just before I upgrade HA. That ensures that I can do a quick recovery if it all goes horribly wrong.

It also means if anything goes wrong with creating that backup, I know about it immediately. Thatā€™s rather important when youā€™re over-writing your existing backup with a fresh one :wink: