HAOS - reduce disk writes?

I followed the KVM install guide at Linux - Home Assistant - and everything works.

I installed on an HDD and I can hear it writing to disk a few times per minute. I can see the .qcow2 file being updated every time the disk chunters.

Moving it to a quieter disk will mask the symptoms, but I’m worried about wearing out my SSD.

How can I reduce the number of times it writes to disk?

This option doesn’t work on HAOS - Reducing IO in home assistant (supervised)

Lots of the options here seem outdated - Steps to reduce Write Cycles and extend SD/SSD life expectancy - #11 by typxxi

I’ve set

recorder:
  commit_interval: 360

After a restart, I’m still seeing disk writes at least twice per minute.

Running this command to see what’s being written: find / -path /proc -prune -o -path /sys -prune -o -path /dev -prune -o -mmin -1 -type f -exec ls -l --full-time {} + | sort -k 6

Shows the follow files are being updated approximately every 30 seconds.

/mnt/overlay/var/lib/systemd/timesync/clock
/var/lib/systemd/timesync/clock
/mnt/data/logs/81…6f/system.journal
/var/log/journal/81…6f/system.journal

I don’t need an NTP sync twice a minute - once per day would be fine.

I rarely look at the logs, so I’m happy to have them written once an hour or similar.

Is there a 2025 guide for making HAOS less chatty on disk?

Ha is functionally a state engine riding a database.

Which means less chatty on disk is not a thing as far as HA is concerned… that’s what you need to PLAN for.

Read: that’s what it does and exactly why most people recommend avoiding SD (because this use they typically wear out in a year or so…)

Your best plan is to read up and reduce recorder writes if you’re that concerned about it.

You mentioned something about once an hour? No think in milliseconds…

With SSDs or HDDs, this should not be a cause for concern - you will not write them to death this way (unrelated firmware crashes or just failures are way more likely). SD cards, USB stick or eMMC would be another topic - and better best avoided, in favour of better -cheaply replaceable- alternatives (SSD/ HDD).

1 Like

As I say in my post, I set the recorder to 300 seconds - but that didn’t make a difference. I did that following Recorder - Home Assistant

If you can suggest anything else to read, I’d be most grateful.

My point was that’s about all you do. The rest is os level. If you have the recorder tuned then you’re as good as youre going to get.

Ideally it never stops writing to disk at all, and the disk is writing every few milliseconds - in other words as far as a human can tell, constant write op.

This way, if there’s a crash, power failure or whatever, you won’t lose the state of anything when it boots back up.

If after 5-10 years you need to replace an SSD, who cares? An SSD that cost you $20 when you first set up is going to cost you $2 later on.

If you wanted to save yourself the price of a replacement SSD, you might spend 10-100x more to outfit a machine with a very large amount of RAM and then run the entire VM out of a ram disk. There’s no situation I can think of where this makes any sense.

2 Likes

These are systemd paths. I’ve not tried configuring HAOS’ systemd options but on my desktop I’d be looking at timesyncd and the SaveIntervalSec option which defaults to a minute for its SNTP configuration (it’s not a full NTP client).

Looking at the journald options are more confusing. Unless you tell systemd not to journal to storage at all, it’s going to sync any time a message of CRIT or higher is received, or otherwise use the SyncIntervalSec of a minute. I think. journald can stream to a socket instead, but it’s synchronous and verbose, and the manpage implies it’s not a good idea.

In theory you can add your settings to your own whatever.conf file in /etc/systemd/timesync.conf.d and /etc/systemd/journald.conf.d and restart.

The issue is that /etc/systemd/ as well as most of the rest of the OS is read only.

@edent
There are some things that are configurable. You could modify the *Interval* variables of timesyncd.conf for example, but if you want that much control over the OS HAOS isn’t for you and you should use the docker installation method or create feature requests for more configuration options.

I think this is a non-issue for a proper SSD. HAOS is designed to be able to run on things like the green which uses eMMC. If you’re really that concerned you can get a Intel DC SSD for < 30 bucks on eBay.
Give this SSD Useful Life Calculator a look. Write amplification not included but hopefully this can ease your concern.

1 Like