× NETGEAR will be terminating ReadyCLOUD service by July 1st, 2023. For more details click here.
Orbi WiFi 7 RBE973
Reply

Manually create SMB and NFS share

F_L_
Tutor

Manually create SMB and NFS share

I´ve managed to create my own SMB-share in /etc/frontview/samba/Shares.conf and /etc/frontview/samba/addons/addons.conf
This seems to work.

But what is the proper what to add it as NFS?

Running 6.1.6:
Is there a way to make it visible in Frontview?


Thanks
Message 1 of 12
fastfwd
Virtuoso

Re: Manually create SMB and NFS share

https://www.google.com/search?q="etc%2Fexports"

It's possible that Frontview gets its NFS share information by parsing the etc/exports file. If so, your NFS share will automatically be shown in Frontview.
Message 2 of 12
F_L_
Tutor

Re: Manually create SMB and NFS share

Thank you fastfwd but I guess I am looking for something more ReadyNas specific like the addon file for SMB.
Problem is that the entry in etc/export doesn't stick after a NFS toggle in Frontview.


# exportfs -a
# exportfs
/home <world>
/data/Music <world>
/data/Videos <world>
/data/dir/dir2/Videos2
<world>


Then toggle NFS:


# exportfs
/home <world>
/data/Music <world>
/data/Videos <world>
Message 3 of 12
fastfwd
Virtuoso

Re: Manually create SMB and NFS share

F.L. wrote:
Problem is that the entry in etc/export doesn't stick after a NFS toggle in Frontview.

When you say "after an NFS toggle", do you mean "after disabling NFS in Services:Standard File Protocols, hitting Apply, then re-enabling NFS and hitting Apply again"? On my system, the share disappears when the NFS server is disabled, but then reappears in the exportfs list when NFS is re-enabled.
Message 4 of 12
F_L_
Tutor

Re: Manually create SMB and NFS share

Yes, In the System -> Services I click on NFS and uncheck the box Enable NFS, then APPLY.

On my Ultra the "standard" shares are still visible when running exportfs, even if NFS is disabled (NFS button is not green).
However, my share that I added by editing etc/exports and exportfs -a disappears.
Message 5 of 12
fastfwd
Virtuoso

Re: Manually create SMB and NFS share

F.L. wrote:
Yes, In the System -> Services I click on NFS and uncheck the box Enable NFS, then APPLY.

Wait... So you're only disabling NFS, not also re-enabling it?

F.L. wrote:
On my Ultra the "standard" shares are still visible when running exportfs, even if NFS is disabled (NFS button is not green).
However, my share that I added by editing etc/exports and exportfs -a disappears.


That's not how it works on my Ultra 2 Plus (OS 4.2.26).

With NFS enabled in Frontview:System:Standard File Protocols, I created a share from within Frontview and enabled NFS access to it. That automatically added it to /etc/exports and made it appear in the exportfs output, as expected:
NAS2:/# cat /etc/exports
"/nfstest" *(insecure,insecure_locks,ro,sync)
NAS2:/#
NAS2:/# exportfs
/c/nfstest <world>
NAS2:/#


Then I disabled NFS from Frontview. This cleared the exportfs output (note that this behavior is different from what you reported):
NAS2:/# exportfs
NAS2:/#


Then I edited /etc/exports manually to add a new share:
NAS2:/# cat /etc/exports
"/nfstest" *(insecure,insecure_locks,ro,sync)
"/nfstest_manual" *(insecure,insecure_locks,ro,sync)
NAS2:/#


Exporting the shares, even with the NFS server stopped, made them both show up in the exportfs output (I didn't expect this):
NAS2:/# exportfs -a
exportfs: /etc/exports [1]: Neither 'subtree_check' or 'no_subtree_check' specified for export "*:/nfstest".
Assuming default behaviour ('no_subtree_check').
NOTE: this default has changed since nfs-utils version 1.0.x

exportfs: /etc/exports [2]: Neither 'subtree_check' or 'no_subtree_check' specified for export "*:/nfstest_manual".
Assuming default behaviour ('no_subtree_check').
NOTE: this default has changed since nfs-utils version 1.0.x

NAS2:/# exportfs
/c/nfstest_manual
<world>
/c/nfstest <world>
NAS2:/#


Re-enabling NFS from within Frontview didn't change anything; exportfs still shows both shares:
NAS2:/# exportfs
/c/nfstest_manual
<world>
/c/nfstest <world>
NAS2:/#


Disabling NFS from within Frontview makes them both disappear from the exportfs output (again, this is not the behavior that you reported):
NAS2:/# exportfs
NAS2:/#


And re-enabling NFS brings them both back:
NAS2:/# exportfs
/c/nfstest_manual
<world>
/c/nfstest <world>
NAS2:/#


I don't know why your system apparently behaves differently from mine, but I'm also not too sure that it matters: Do we really care whether a directory appears in the exportfs list while the NFS server is disabled? The important thing is that it's in the exportfs list while the NFS server is running, right?
Message 6 of 12
StephenB
Guru

Re: Manually create SMB and NFS share

I am puzzled as to why OP is so determined to do this outside of Frontview.
Message 7 of 12
fastfwd
Virtuoso

Re: Manually create SMB and NFS share

He might want to export a directory that's outside /c.
Message 8 of 12
StephenB
Guru

Re: Manually create SMB and NFS share

fastfwd wrote:
He might want to export a directory that's outside /c.
I guess (though it would be /data since OP is running OS6) . Then making the OS directory available in Frontview would be for backup purposes??

Anyway, it might be helpful to know the goal.
Message 9 of 12
F_L_
Tutor

Re: Manually create SMB and NFS share

fastfwd
fastfwd wrote:
F.L. wrote:
Yes, In the System -> Services I click on NFS and uncheck the box Enable NFS, then APPLY.

Wait... So you're only disabling NFS, not also re-enabling it?

F.L. wrote:
On my Ultra the "standard" shares are still visible when running exportfs, even if NFS is disabled (NFS button is not green).
However, my share that I added by editing etc/exports and exportfs -a disappears.


That's not how it works on my Ultra 2 Plus (OS 4.2.26).

With NFS enabled in Frontview:System:Standard File Protocols, I created a share from within Frontview and enabled NFS access to it. That automatically added it to /etc/exports and made it appear in the exportfs output, as expected:
NAS2:/# cat /etc/exports
"/nfstest" *(insecure,insecure_locks,ro,sync)
NAS2:/#
NAS2:/# exportfs
/c/nfstest <world>
NAS2:/#


Then I disabled NFS from Frontview. This cleared the exportfs output (note that this behavior is different from what you reported):
NAS2:/# exportfs
NAS2:/#


Then I edited /etc/exports manually to add a new share:
NAS2:/# cat /etc/exports
"/nfstest" *(insecure,insecure_locks,ro,sync)
"/nfstest_manual" *(insecure,insecure_locks,ro,sync)
NAS2:/#


Exporting the shares, even with the NFS server stopped, made them both show up in the exportfs output (I didn't expect this):
NAS2:/# exportfs -a
exportfs: /etc/exports [1]: Neither 'subtree_check' or 'no_subtree_check' specified for export "*:/nfstest".
Assuming default behaviour ('no_subtree_check').
NOTE: this default has changed since nfs-utils version 1.0.x

exportfs: /etc/exports [2]: Neither 'subtree_check' or 'no_subtree_check' specified for export "*:/nfstest_manual".
Assuming default behaviour ('no_subtree_check').
NOTE: this default has changed since nfs-utils version 1.0.x

NAS2:/# exportfs
/c/nfstest_manual
<world>
/c/nfstest <world>
NAS2:/#


Re-enabling NFS from within Frontview didn't change anything; exportfs still shows both shares:
NAS2:/# exportfs
/c/nfstest_manual
<world>
/c/nfstest <world>
NAS2:/#


Disabling NFS from within Frontview makes them both disappear from the exportfs output (again, this is not the behavior that you reported):
NAS2:/# exportfs
NAS2:/#


And re-enabling NFS brings them both back:
NAS2:/# exportfs
/c/nfstest_manual
<world>
/c/nfstest <world>
NAS2:/#


I don't know why your system apparently behaves differently from mine, but I'm also not too sure that it matters: Do we really care whether a directory appears in the exportfs list while the NFS server is disabled? The important thing is that it's in the exportfs list while the NFS server is running, right?


I am enabling it again.
Strange that it doesn't behave the same way but I fully agree with you that it doesn't matter how it looks when NFS is disabled.
StephenB: I would prefer to do it in FrontView if possible, didn't think it was.

Basically I want to achieve this:
I have an already created folder I want to share using Samba and NFS.
Eg: \data\dir1\dir2\FolderToShare

I can't see any option to browse an already existing folder using "New Folder" under Shares.
So I assumed the only way was to add it manually in Shares.conf/addons.conf (for Samba) and to do something similar for NFS.

A workaround might be to create FolderToShare using FrontView and then change the path in Shares.conf/exports?
I will try this.
EDIT: Didn't work for me...
Message 10 of 12
StephenB
Guru

Re: Manually create SMB and NFS share

Got it. If you create FolderToShare in Frontview, then you have a couple other options to try.

(a) simply move \data\dir1\dir2\FolderToShare into \data\FolderToShare. That obviously works, but you end up with only one path to FolderToShare. That's what I would do.

(b) You can also try deleting \data\FolderToShare from ssh (after you create it), and then create a soft link to \data\dir1\dir2\FolderToShare. I am not sure if that will work, but it is easy to try.
Message 11 of 12
F_L_
Tutor

Re: Manually create SMB and NFS share

Ok, I tried to do no2 but it seems to be harder that expected.

It was possible to delete the folder in samba (I have /data/ mapped) but it appears immediately again.
Disabling SAMBA and using SSH gives me the error below (I´m root):


# rm -rf FolderToShare
rm: cannot remove FolderToShare: Operation not permitted


Notice that to see the share in FrontView is just a bonus. If it is possible to get it to work without it I´m more than happy.
Samba is working (addons.conf) it is just the NFS part that doesn't.
Message 12 of 12
Top Contributors
Discussion stats
  • 11 replies
  • 2171 views
  • 0 kudos
  • 3 in conversation
Announcements