Running HAOS from a read-only partition

Hello everyone!

I’m trying to build a very simple but reliable HA system which will, once set up, never be touched again. I’m using Raspberry PI 5 and HAOS. The biggest problem I see is that, no matter what storage medium is used, a power outage in a middle of a write operation can result in data corruption and then the system won’t start again on its own and someone has to fix it. So I would like the system to boot from a microSD card, run from RAM and not write anything to the card at all.

I’m fully aware of all the drawbacks of this approach. I know I won’t have access to any logs if the system crashes, I know that updates or changes in configuration will be cumbersome and I know that all history would be lost at shutdown. I don’t care about all that. For this application I don’t need history, no changes are planned, all updates are disabled (and nothing can even talk to the RPi over network) and the setup is already thoroughly tested.

I’m actually surprised that this is such a rare request. For me, knowing the system will work reliably after a power loss while I’m far away is essential. The only uselful thing I have found so far is this quite old thread: https://www.reddit.com/r/homeassistant/comments/8i2n3r/how_can_i_run_home_assistant_from_ram_off_a_read/
It ultimaly links to this solve_raspbian_sd_card_corruption_issues_with_read-only_mounted_root_partition [pswiki]

However, this is not directly applicable to HAOS, with Core running in a Docker container. How would I do what is necessary to achieve the behavior described above?

I thank you all in advance!

Unlikely to be possible with HAOS.
For the other installation methods, you could use overlayfs to have the RW config directory overlaid above a RO base configuration.

I used to create custom “live cd” images to run my internet-facing proxy servers entirely in RAM. It’s not hard if you can start with an existing live cd image and just modify it with a few custom apps and package updates.

But HAOS is not distributed with a base live cd image, and some quick searching suggests that buildroot, the toolchain they use to compile HAOS, only supports building live CD images for x86 architectures, which maybe explains why they haven’t released one. So even if you decided to take on custom compiling your own live image distro of HAOS you would likely have to get a new computer to run it on.

If you’re willing to compromise on the OS, perhaps consider modifying an existing live Debian image into a supervised HA server, which is close but not quite HAOS. If you don’t need supervised, Ubuntu makes a great HA docker host, and there are tools like Cubic to make customizing the Ubuntu live image very easy.

Thank you both for your answers.

I chose HAOS because it’s the officially recommended way to install HA on Raspberry Pi. I haven’t dug that deep into the matter so I’m not quite sure what practical differences exist between supervised and core installations. From what I can tell, without the supervisor, updates are more complicated (for this project I don’t care about updates at all) and there’s no add-on support. However, I have only ever used File editor and SSH. I don’t think it should be a problem to achieve that functionality in some other way. So, would I need supervised? You tell me :smiley:

Of the proposed methods, customizing the Ubuntu live image seems to me to be the simplest. But here’s an interesting question: if I make a backup of my HAOS installation, could I restore it onto a clean core installation? I suppose you can’t restore the add-ons but everything else should work, right?

Of course, the topic remains open to other suggestions if an idea springs up to do this with HAOS (but your answers lead me to think that it can only be more complicated, if possible at all).