Hi all,
I can only see ‘/’ from within hassio which refers to the folder ‘/usr/share/hassio/homeassistant’ under ubuntu because of docker container. I need to reach to some other folders on ubuntu from within hassio, due to some requirements. Like:
And of course i can’t use the lines marked with ‘#’ . As i searched for this issue, i see that i need to use bind mount on homeassistant docker container. As i am not docker competent, i tried to use portainer for this; but as i understand i cannot bind mounts on a working homeassistant container; because i can’t see any active bind mount config page on this container. Do i need to duplicate ha container, handle bind mounts and then use this container instead? Can you guys show me how to handle this?
Thanks…
UPDATE: Is adding ‘/media/hdd’ to ‘/etc/systemd/system/hassio-supervisor.service’ makes sense?
In order to achieve this; i was trying to mount volume to homeassistant container. Some suggested that i should clone homeassistant container, mount the necessary volumes and use this container instead. As i was saying i am not that good with docker issues; so was searching for an alternative method. I came across this https://stackoverflow.com/questions/28302178/how-can-i-add-a-volume-to-an-existing-docker-container ; and the 3rd answer was the thing i was looking for.
In order to mount-bind an external volume to the existing container; you can follow these steps:
From portainer or any other means; find the folder of homeassistant container (Containers stay at folder : /var/lib/docker/containers/ . Under this folder there are folder names like b1094552678378ac7878 etc. Find the corresponding folder.
(As root) Stop the docker service:
$ service docker stop
Inside the container folder, open config.v2.json with nano, vi, vim etc.
Find the “MountPoints” part inside the json, after “/config”, “/share” and “/ssl” mount points which are already there add your volume here like:
IMPORTANT:
Please understand that i accept no responsibility for any problems that may arise from doing this procedure. I am in the testing phase for now; will inform you after i test everything.
EDIT: You have to renew this procedure everytime you update HA, since a new docker container is created for the new version HA.
I’m having some difficulties getting this to work. Is it still working for you? My main goal is to be able to save snapshots/records from my cameras onto my NAS from hassio (technically Home Assistant Core now). I made the changes in the config.v2.json file but when i restart the containers, the folder still shows up empty in the HA File Editor. I currently map my NAS drive on my Ubuntu VM to /mnt/cctv, and added the the destination to be “/cctv” in the json file.
Any help you could provide would be great. Thanks!
Could be related to linux permissions and/or mountpoints RW issues. If you can send your config.v2.json file in a private message i can have a look at it…
I’m trying to implement this in my RPI3 but I’m not familiar with this.
I’m stuck in the first step, I’m trying to use Portainer addon.
It is possible to do some snapshots using Portainer so I and other like me can implement it?
Go to Portainer; Select Primary and then select Conatiners (Or directluy select containers in the Portainer side menu. Then go find Container named ‘homeassistant’:
Used this solution but I had to restart the server after editing the file - starting docker again wasn’t enough. But it seems to be working , thanks alot @febalci !
I konw it’s and old paste but it help me a lot for the process and i got a question to be sure if the problem is on my side or not.
Before start, thanks a lot to Erkan !
current situation :
system : haos_generic-x86 >> OS 12.4 & HA Core 2024.8.1
i do the same for the folder “/mnt/data/external_data” mapped to “/external_data”
differences :
– i don’t change “volumes”:… because original was “volumes”:null ans i stay it as it is
– i’ve test to change from rprivate to rslave, but the 2 options works without solving my problem
– i need to override “/var/lib/docker/containers/CONTAINER_ID/config.v2.json” and “/mnt/data/docker/containers/CONTAINER_ID/config.v2.json” and directly reboot without restart docker to have persistante updates
it’s work perfectly to get the access to read/write in the folder by script (recording videos to an area that is not include in full backup…)
My Problem :
I can't access this storage folder from other extensions/modules (tested with VSCode and Rclone Backup).