I finally got it working!
Basically @Christianb233 message made me carefully redo all @BloodRave steps and keep trying until it got working.
/etc/fstab contents in container HomeAssistant (login as root through Portainer add-on).
192.168.8.18:/public_m3 /mnt/media nfs4 rw,async,hard,intr,noexec 0 0
Make sure you create /mnt/media folder before mounting.
I should point out, that /export/public_m3 and nfs share type did not work for me, although it works everywhere else. This was the last step to get it working, so all other things that I did, might be unnecessary.
My NFS share is on openmediavault, in there I set allowed clients to be * instead of 192.168.8.0/24
Extra options that I set to the NFS share, I set anonuid to be root
subtree_check,insecure,no_root_squash,anonuid=1000,anongid=1000
configuration.yaml
homeassistant:
media_dirs:
public_m3: /mnt/media
shell_command:
mount_nas_media_folder: mount -a
automations.yaml
- id: ha_start_event
alias: HomeAssistant Start
trigger:
- event: start
platform: homeassistant
action:
- delay: 00:02:00
- service: shell_command.mount_nas_media_folder
While trying to mount from ha container console using command ‘mount -a’, these errors occurred:
- Permission denied - worst case. Seems I had permission issue with Client config on OMV.
- Connection refused - next error I had after fixing permission issue. It was due to using nfs instead of nfs4.
- File directory not found - last error I had. It was due to using /export/public_m3 with nfs4, dropping /export directory fixed it all.
Now writing this comment, checked that I can omit fstab configuration, and mount using shell command
shell_command:
mount_nas_media_folder: mount -t nfs4 192.168.8.18:/public_m3 /mnt/media
instead of 'mount -a'
and fstab combo.
Thanks @BloodRave and @JZhass for commenting your solutions!