Raspberry Pi SD card wear

This is about the Home Assistant OS for the embedded Raspberry Pi, not other operating systems that core and supervisor can run on. I experienced SD card wear out (card turned itself into a write only device) using openHAB on a Raspberry Pi. I am concerned about using the SD card to store logs (a lot of writes) and backups (unavailable after card failure).

/etc/fstab has a lot of entries to use volatile memory for some high write directories, but some concern still remains.

Can a USB hard drive or wired local NAS (SMB, NFS) be used to store logs and backups on Home Assistant OS. If so how is it configured into Home Assistant OS.

– Retired software developer

[SOLVED]

I found information at https://github.com/home-assistant/operating-system/blob/dev/Documentation/partition.md about migrating the data from the SD to a USB hard disk. It even includes pointers for getting real root access by plugging a keyboard into the pi or enabling debug access in ssh. It works well for me. I boot and run from the SD card. All the writable data is on the USB hard disk. Wear problem solved!

I can answer about the backups: No.

This is a source of ongoing frustration with HA. I’ve raised this issue several times, and there doesn’t seem to be any support for an option to create the snapshots on some other device.

Before anyone posts links to the various backup add-ons, note that they all only COPY the snapshot from the SD card. None I’ve seen actually let you CREATE the backup elsewhere in the first place. This obviously does not cut down on the writes to SD.

Is converting your Pi ti run a M.2 SSD not an option for you?

(it took me about an hour to update a Pi4 to boot!/run from a 256G SSD and restore Homeassistant from a snapshot). Runs MUCH faster and i dont have to worry about this issue anymore…

1 Like

There’s a thread here about using a Synology NAS for logging (if you have one):

This reduces wear on the SD card considerably.

Alternatively, you can run HA on a USB hard drive or ssd. You still need a SD card in the Raspberry Pi, but it is only used when rebooting. Community guide here:

Edit: I see @NathanCu beat me to it…

You do not need the SD card in the Pi ad long as its a Pi4 anf youve done the bootloader and firmware updates… Mine was removed and repurposed as soon as the upgrade was completed…

I run headless Home Assistant OS runs on a Pi 3B+. I do not have any issue booting or running on an SD card or SSD. Both have limited writes and I prefer to use a hard drive for stuff that is written a lot, but seldom read.

I like Home Assistant OS built for the Raspberry Pi. I just need to figure out how to add a USB hard drive and mount a couple of directories to it. SSH into the Pi and change /etc/fstab doesn’t seem to work.

I run gentoo Linux on all the workstations on my home network. They all boot and run from SSD. A hard drive is mounted to /var and selected temp directories used when compiling large ebuilds. This is done to reduce ssd wear as a lot of the system is recompiled often because gentoo is a rolling distribution compiled from source files. It works well for me.

Backups are done daily with Bacula and the files are written to a hard drive on another computer. A “file daemon” runs on each workstation and is controlled by the “Bacula director” running on one of the workstations. For the purpose of making backups only a file daemon runs the the system being backed up. I don’t know of a Bacula file daemon for the Home Assistant OS. I have written a Linux kernel driver, but have no experience developing Docker stuff.

Nope. The setup described in the guide does not need an SD card anymore. It boots and runs from SSD. What you describe was the old way that had to be used before HA OS 5.