I then bought a new 132 GB SD and it run until this week. Now it is also corrupted with the error:
mmc0: Got data interrupt 0x00000002 even thought no data operation was in progress.
blk_update_request: I/O error, dev mmcblk0, sector 144033792 op 0x0:(READ) flags 0x83700 phys_seg 16 prio class 0
this keeps spamming with new sector numbers. Then:
INFO: task kworker/3:1:48 blocked for more than 120 seconds.
Tainted: G C 5.10.17-v8 #1
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message
Then back to the other message and it keeps going for hours.
There are numerous descriptions and opinions on using a SD card for HA. Make sure to use a high quality SD card. Make sure the power supply for the RPi is strong enough, especially if you have external devices like a zigbee coordinator/SSD HD.
A alternative is to use a SSD for the datapart of HA. Super easy to implement, buy a SSD, attach to a USB port, chose to migrate data to the SSD. The RPi will then boot on the SD, however all data will be on the SSD, hence no more writing to the SD card.
If you are going to go to an SSD, might as well make it boot off SSD and take the SD completely out of picture. It’s easy now that there is a utility on Raspberry’s website. All 3 of my RPi4 use SSD incl one running HA.
With two HA systems for years and three SD failures, I would say the only use case for SD over an SSD boot disk is if your system is pretty basic. The potential for total failure is high and it’s not HA’s fault, it’s the nature of SD and how many times you can write to it - so consider if you have lots of logging and lots of database activity then those alone are hitting that SD constantly.
Even in my RV version of HA where I have just a handful of devices I moved it to an SSD even though it is only used sporadically because I just don’t want to risk it. That being said, I could use SD there because there isn’t a lot of constant activity, I don’t stream cameras or anything else to HA and don’t have add-ons that manipulate files.
It’s a case of “just because you can doesn’t mean you should”. If you got a 132GB SD then I assume you are using HA more than the average bear and have likely outgrown SD.
The other real benefit of SSD is the speed, it’s monumentally faster and you’ll notice it immediately. I have since moved my fairly large and complex HA to a virtual machine and, again, it was many times faster than the SSD was too - however my RV still runs an SSD and I’m perfectly happy to keep it there.
I didn’t do any special database or logging stuff, just the default installation. But good to know that haos is not compatible with SDs, they should write that more clearly during the installation though.
The basic installation of HA runs a simple sqlite database. That is really only good enough to test out HA to see if it’s a system that you like and want to continue investing your time and money. (For evaluation purposes that is fine to run on an SD card).
Once you have upgraded to an SSD, you should also upgrade to a proper database like MariaDB. It’s a pretty simple procedure to do and there are plenty of resources that explain how to do it.
Idk, connecting an SSD seems complicated, you need to pry the rspi out of the existing chassis and put it into a new chassis.
I ordered 2 more SD cards, if HAOS destroys 1 SD card per year, that’s an operating cost of 1€/year. Seems reasonable. I just have to make sure I always have a recent backup for the yearly SD card switch.
There are several ways to get rid of the SD with an SSD. The most minimalistic way is to use a high quality usb stick. You don’t need to pry the PI open to do that.
Therefore I strongly suggest not to stick with SD cards
The problem is the default recorder settings are every 5 seconds, for every device. This probably is too frequent for an sd card. It can be increased in the config settings.