Is there a way to disable atomic writes in Home Assistant? (git versioned config, bind-mounted files, cron backup)

I’m hoping someone has a workaround or advice for disabling atomic writes in Home Assistant, or at least handling them differently.

My setup:

  • Home Assistant runs in Docker.
  • All my config files (configuration.yaml, automations.yaml, etc.) are bind-mounted into the container from my git repo, alongside my docker-compose.yml.
  • Every 15 minutes, a cron job on the host commits and pushes any config changes to git, so my YAML files are always backed up and versioned.

Why do it this way?

  • I can edit all my config files directly on the host using my preferred editor. No problem there.
  • Version control is simple: my repo stays in sync with my Home Assistant instance.

The problem:
When I try to save config changes using any of the built-in Home Assistant UI editors (like the Automations or Scripts editors), saving fails. The log shows an error like:

OSError: [Errno 16] Resource busy: ‘/config/tmpabc123’ → ‘/config/scripts.yaml’

  • This happens because Home Assistant writes config changes using an atomic write pattern (write temp file, then rename/move it over the original).
  • This pattern doesn’t work on individually bind-mounted files, because Docker treats the target as a mount point and refuses to overwrite it.
  • Editing on the host still works fine—but the UI editors are basically useless unless I rework my whole mount strategy.

I get the risk of corruption if something goes wrong mid-save, but I accept that risk because I’m always backed up to git anyway.

Has anyone found a workaround for this that still allows using both host editing and the Home Assistant UI editors with bind-mounted config files?

Just an update for anyone following:

I tried working around this by splitting my automations, scripts, and scenes into directories using the !include_dir_merge_list and !include_dir_merge_named directives. This did not solve the UI editing problem. The Home Assistant UI still cannot edit anything that is not in the default flat file such as automations.yaml or scripts.yaml. With bind-mounted files or directories, you still get the same atomic write error when trying to save from the UI.

Bottom line:
If you are bind-mounting your config files or directories, you will not be able to use the Home Assistant UI to create, migrate, or edit automations, scripts, or scenes. You have to edit them outside the UI.

That is what I am doing now. I just stick to editing on the host and ignore the UI editors.

If anyone ever finds a real workaround, I would like to hear about it. As far as I can tell, this is just a fundamental limitation with how Docker and atomic file operations interact.

1 Like