I wanted to mount an NFS share which I had done before. So I did the usual and added an NFS share via gui:
This didn't work at first, a subdirectory in the shared directory was empty when accessed remotely. Since this directory was bind-mounted to this folder I found that I needed to add 'crossmnt' as an extra option. So, I did that and then when mounting the NFS share I got the directory but this time when trying to access it I got -bash: cd: downloads: Stale file handle.
After some better reading I realized I also needed to provide an NFS share of the subdirectory itself.
This is where the real trouble began for me since the GUI only allows you to share Shared Folders.
So my next attempt was to create a Shared Folder called 'downloads' mapped to the (bind mounted) subdirectory and also add it to the NFS shares.
This, however, still didn't work. I still got the stale file handle error.
Then after some trial, error and research I found that in order for crossmnt to work the bind-mounted inner NFS share has to be shared as a subdirectory of the main share.
To test this hypothesis I went to /etc/exports which was:
# This file is auto-generated by openmediavault (https://www.openmediavault.org)
# WARNING: Do not edit this file, your changes will get lost.
# /etc/exports: the access control list for filesystems which may be exported
# to NFS clients. See exports(5).
/export/media1 192.168.20.106/20(fsid=df3eae7f-de6a-47f5-adfb-292b3c255e46,rw,subtree_check,insecure)
/export/media2 192.168.20.106/20(fsid=87fb07da-43de-4fee-896c-48383281a5d7,rw,subtree_check,insecure)
/export/SeedTransfer 192.168.20.106/32(fsid=f6462e1c-1399-4b8a-a1aa-38837d568fdf,rw,subtree_check,insecure,crossmnt)
/export/downloads 192.168.20.106/32(fsid=3852eb3a-87a1-4042-8951-8e4e73e242de,rw,subtree_check,insecure)
/export 192.168.20.106/20(ro,fsid=0,root_squash,subtree_check)
/export 192.168.20.106/32(ro,fsid=0,root_squash,subtree_check)
Display More
(I'll change those 20 to 32 later, idk how that happened)
And changed /export/downloads to /export/SeedTransfer/downloads:
# This file is auto-generated by openmediavault (https://www.openmediavault.org)
# WARNING: Do not edit this file, your changes will get lost.
# /etc/exports: the access control list for filesystems which may be exported
# to NFS clients. See exports(5).
/export/media1 192.168.20.106/20(fsid=df3eae7f-de6a-47f5-adfb-292b3c255e46,rw,subtree_check,insecure)
/export/media2 192.168.20.106/20(fsid=87fb07da-43de-4fee-896c-48383281a5d7,rw,subtree_check,insecure)
/export/SeedTransfer 192.168.20.106/32(fsid=f6462e1c-1399-4b8a-a1aa-38837d568fdf,rw,subtree_check,insecure,crossmnt)
/export/SeedTransfer/downloads 192.168.20.106/32(fsid=3852eb3a-87a1-4042-8951-8e4e73e242de,rw,subtree_check,insecure)
/export 192.168.20.106/20(ro,fsid=0,root_squash,subtree_check)
/export 192.168.20.106/32(ro,fsid=0,root_squash,subtree_check)
Display More
And then reload the exports using sudo exportfs -ra.
Et voilà, now when mounting the NFS share from the other machine we can access the subdirectory and see its contents.
But now the real question, is there a way to accomplish this from the GUI. Because, as the /etc/exports files says, the changes I made to this file will be lost if I change stuff from the GUI.
Thanks in advance,
Karel.