Has anyone managed to connect a NAS to an HAOS instance using storage or any other method? I have tried different ways and get the following errors in the logs, or similar errors if I try using SSH.
Failed to to call /mounts - Could not unmount qnap2 due to: Transaction for mnt-data-supervisor-mounts-qnap.mount/stop is destructive (mnt-data-supervisor-mounts-qnap.mount has ‘start’ job queued, but ‘stop’ is included in transaction).
Failed to to call /mounts - Reloading qnap did not succeed. Check host logs for errors from mount or systemd unit mnt-data-supervisor-mounts-qnap.mount for details.
Failed to to call /mounts - Mounting qnap did not succeed. Check host logs for errors from mount or systemd unit mnt-data-supervisor-mounts-qnap.mount for details.
When troubleshooting I can mount the NAS share using both CIFS and NFS from a Linux machine and am confident the NAS, network and creds are all OK.
Based on trying different variations for the parameters in both the HA front end or through SSH it looks like some sort of rights issue on the Docker host. Don’t know much about Docker, but it seems that the HA app in the container can’t create the mount point on the Docker host.
As seen above, I have create a NFS share for media (as you choose from the HA app => Settings => System => add storage) . This works for home assistant OS on Virtual Machine.
HomeAssistant in Docker
If you are using HA Docker, maybe you can try to nfs mount the directory on the docker host first then pass to the container via volume mount (for media)?
Yes. My Frigate storage is approaching 40GB which I did not want on my host computer. I have a RAID storage shared with Samba/CIFS that I use for my /config/media. (Settings → System → Storage)
Yes, and I’ve just gone through it again. The “Network storage configuration” section doesn’t give examples on the format of the share name, like if it needs a leading / character. But there are enough examples and comments from the community to work that out.
As mentioned, the troubleshooting from a different machine and the results from the SSH sessions point to the issues being with Home Assistant not being able to create, or needing the mount points to be already created in, the Docker host. My next step is how to SSH into the Docker host itself.
I run HAOS bare-metal. No Docker on Debian, and no VM. I don’t need the additional complexity and learning curve of unnecessary software. No port or RAM management that can be a vector for issues.
The share name is the name given to the shared folder. Is your NAS a Linux host? Look for /etc/samba/smb.conf and post that file here.
For instance, I have a NFS share on 10.10.10.201:/mnt/shared (with some files inside, movie etc) and a Ubuntu OS running a docker. You can mount it as follow using the os terminal:
Here is my mounting setup for the home assistant core dev container (docker). Depend on your setup, generally, the idea are same:
docker-compose.yml / devcontainer.json etc:
Make sure docker bind the nfs mount of your host machine to the home assistant container (media directory in this case)
configuration.yaml:
Make sure the media_dirs point to the path of home assistant container media directory (same level with /config dir: e.g. /workspaces/core/media) Otherwise, it may not appear in the media menu.
It’s been a while, but I think it was installing the OVA image for ESXi from Alternative - Home Assistant. This created the environment, so while you can connect to Home Assistant you are only connecting to the HA Container that sits under the Docker install. This has been fine, but when trying to mount a network share it is reliant on the Docker “host”.
Thanks for your post. I’m guessing you are running Docker on your machine with the HA container under it, so you will have access to Docker?
The OVA the I installed is self-contained. So you can access the HA container, but not the Docker host itself. (At least not easily.)
That makes it a bit clearer. I’m following the same setup, but it doesn’t look like the HA UI that you show or SSH have the rights to mount a new share in the “stinkin’ docker container”.
Dockerland is a bit different by the looks, For example, there is no /mnt. That sits on the host. I think if I can get to the host I can create it, then use the UI to mount the network storage.
Home Assistant doesn’t create the share. That is done by the NAS or other computer running Samba. Can you see the external folder from your Windows File Explorer? There is your share name. (Frigate in my example).
This is working now. The issue was a setting in the NAS. Using a curl command from an SSH session in HA helped troubleshooting the connectivity. Once that was done it was possible to create a new share from the HA UI.
As an aside, if you want to open a shell in the Docker Supervisor in a HAOS install the easiest way seems to be to use the Advanced SSH & Web Terminal addin (thanks Fenck!) and use a Docker command. I created the following script to connect, but it’s not needed to mount the NAS.