I approve! Chris knows what he is doing and it appears to be the same way I do it so I double approve. lol The only important note and Chris mentions it is that the command might need to be adjusted depending on mount type.
That is why I mentioned you can put the shell command before the automation’s load. I don’t have a delay set and it works fine because the shell runs before the automation fires. It doesn’t appear HA wait’s for everything to load.
I will have to try this. I gave up on getting my NAS connected after many failed attempts using this method. Maybe the delay will sort it out. Thanks
If it is only an issue with the delay then you should be able to call the service manually after everything has booted. That should point you in the correct direction.
The inability to mount external storage may be a deal breaker for me. As much as I love HA, this is such a basic, necessary function for so many add-ons and integrations, it beggars belief it isn’t a standard component.
Why do we have to resort to this;
[SOLVED] HASSOS mount NAS network share - #127 by ukro
Additionally, why is it now possible to write backups, but not read from a Samba share;
https://community.home-assistant.io/t/samba-backup-create-and-store-backups-on-a-samba-share/
Why should we have to resort to that? There’s talk on another thread about making HA easier for beginners.
This should be a core functionality, not something you need an in-depth IT background to support.
There’s a pretty simple write up here… which uses shell command and couple sensors to make sure the nas is available. It’s for frigate. But you can use it for anything
The addition of a sensor to make sure it’s available is a good idea. I might add that to mine along with an attempt to remount if not available.
I’ve basically given up on this. I’ve spent hours pulling my hair out trying to use mount commands without success. I can see my samba server shows an active connection, but when I create files and folders they don’t show up. Seems like the only way I’ll ever get a frigate server is to buy a separate computer and storage and run it off a docker. It’s quite stupid to think that the frigate HA addon has no decent documentation or guide or anything for mounting a network share. You’d think that would be a basic function of HAOS, I guess we should be appreciative that we even have HA to being with.
Join the club!
I’m a little surprised you are having so much trouble. I recommend you just give it a break and come back to this in a week or so. Some systems are a little finicky I suppose.
It wasn’t any easier the second or third time I approached it. Is anyone actually capable of mounting a share to a remote file system on Hassio/haos or whatever it’s called.
Joining the crowd in here. While on paper my NFS mounts should work this way too, I’ve not been successful yet and pretty much have given up on all things media-related within HA. They work everywhere else though, so, eh.
I do think it’s far too tedious to have to set this up manually, too. I do have an integration with my NAS (since it is running OpenMediaVault), but said integration fails often and, anyway, doesn’t provide a media source. Nor would the TrueNAS integration, if I were to eventually move my NAS setup there.
This is, how it works for me, using OMV NAS.
Yeah, but that’s SMB. I don’t want SMB on my network.
Nice to see this is still going on.
I tried to do this years ago on HassOS/haos with NFS but there was no kernel support, I tired messing round with udev but it loads too fast so I ended up using CIFS.
Not sure why some people can’t get it going it’s a easy process.
I’ve been doing this for a year or so… It’s pretty much the same as the same as sean’s method but I do use a manual process each time HAOS(not HA) reboots.
I have multiple isolated networks running HA for dev, testing and prod.
For my production HA environment at home I only update it on the last update of every month which means a HAOS restart. I don’t care doing this process once a month manually.
Process is ensure frigate, terminal addon(not 22222 addon) are set to manual start. When HAOS boots up after a cold start:
- Login to to container at port 22222
- run bash script in /mnt/data/
- type: bash /mnt/data/cifs_mount.sh
Here’s the script:
#!/bin/bash
#for x in $(docker ps --format "table {{.ID}}\t {{.Names}}" | grep -E "ssh|frigate" | awk '{ print $1 }'); do
mount -t cifs -o username=user,domain=dom,password=pass //1.1.1.1/NVR_Storage /mnt/data/supervisor/media
if [[ $? -eq 0 ]]; then
df -h | grep media
#CIFSCONTAINERS="hassio_cli addon_ccab4aaf_frigate addon_core_ssh homeassistant"
CIFSCONTAINERS="homeassistant"
for x in $CIFSCONTAINERS ; do
docker restart $x
done
else
echo "Error mounting NVR mount"
fi
You can uncomment the $CIFSCONTAINERS to include the container you want to autostart with the script or use the commented for loop to get container IDs.
Otherwise go back to HA UI and manually start the addons that you’ve configured to use /media
Does that help?
I have tried multiple methods to mount a CIFS share and none have worked. When will devs realise the importance of this for so many uses and users?
They KNOW there’s plenty of us wanting it.
They just seem to NOT want it. Or something. Who knows?
I don’t think it’s anything malicious, or even intentional. If you’ve set up a development environment for HA, you don’t need this feature. You’ve probably got a dozen other ways to do this. It’s simply not a priority.
It’s hard to motivate someone to volunteer their time to work on something for which they simply don’t see the need. Again, nothing against any HA devs. It’s just the way open source works. We users just hope someone comes along who takes pride in developing a system that works for everyone, even those who don’t live and breathe this stuff daily.