[SOLVED] I always thought NFS sharing was superior to Samba but now I'm second guessig that thought

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
gene0915
Level 4
Level 4
Posts: 244
Joined: Sun Oct 26, 2014 7:52 pm

[SOLVED] I always thought NFS sharing was superior to Samba but now I'm second guessig that thought

Post by gene0915 »

Solution: adding

Code: Select all

ExecStartPre=/bin/sleep 15
... to the nfs-server.service file fixed everything. ajgringo619's suggestion was right on the money!

Trying to figure this problem out.

On my fresh install of Mint 19.2 (Cinnamon), I set up NFS sharing as I didn't want to bother with Samba. Here are a few variants of my exportfs file:

Code: Select all

/mnt/md0/pics 192.168.1.1/24(ro,insecure,sync,all_squash,nohide,no_subtree_check,anonuid=1000,anongid=1000)
/mnt/md0/Home\040Movies 192.168.1.1/24(ro,insecure,sync,all_squash,nohide,no_subtree_check,anonuid=1000,anongid=1000)

/mnt/md0/pics pc1(ro,insecure,sync,all_squash,nohide,no_subtree_check,anonuid=1000,anongid=1000)
/mnt/md0/Home\040Movies pc1(ro,insecure,sync,all_squash,nohide,no_subtree_check,anonuid=1000,anongid=1000)

/mnt/md0/pc1\040backup 192.168.1.1/24(rw,insecure,sync,all_squash,nohide,no_subtree_check,anonuid=1000,anongid=1000)
/mnt/md0/incoming 192.168.1.1/24(rw,insecure,sync,all_squash,nohide,no_subtree_check,anonuid=1000,anongid=1000)
/mnt/md0/pc2\040backup 192.168.1.1/24(rw,insecure,sync,all_squash,nohide,no_subtree_check,anonuid=1000,anongid=1000)

/mnt/md0 192.168.1.1/24(ro,insecure,sync,all_squash,nohide,no_subtree_check,anonuid=1000,anongid=1000)
I say variants because those are some of the ways I tried fixing this issue. (Sometimes sharing via the name of the PC that will be connecting, other times opening up the entire sub-net but in the end, they all worked at one point then eventually failed.

Here's what will happen.

I'll get on the server and do an 'exportfs -avr' then 'showmount -e my server ip' from a client and the nfs-server status on the Mint 19.2 box comes up as 'active/running' and showmount from the client shows all the shares and I can map them perfectly fine. I can reboot my client boxes and they reboot and can see the NFS shares. All is well in the universe.

Here is where things go off the rails. If I reboot the server, this is what I get on the server box:

Code: Select all

gene@server-pc:~$ sudo systemctl status nfs-server
● nfs-server.service - NFS server and services
   Loaded: loaded (/lib/systemd/system/nfs-server.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 2019-08-29 19:27:58 EDT; 49min ago
  Process: 1625 ExecStopPost=/usr/sbin/exportfs -f (code=exited, status=0/SUCCESS)
  Process: 1624 ExecStopPost=/usr/sbin/exportfs -au (code=exited, status=0/SUCCESS)
  Process: 1623 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=1/FAILURE)

Aug 29 19:27:58 server-pc systemd[1]: Starting NFS server and services...
Aug 29 19:27:58 server-pc exportfs[1623]: exportfs: Failed to stat /mnt/md0/ally backup: No such file or directory
Aug 29 19:27:58 server-pc exportfs[1623]: exportfs: Failed to stat /mnt/md0/marinaresume: No such file or directory
Aug 29 19:27:58 server-pc exportfs[1623]: exportfs: Failed to stat /mnt/md0/marina backup: No such file or directory
Aug 29 19:27:58 server-pc exportfs[1623]: exportfs: Failed to stat /mnt/md0/Home Movies: No such file or directory
Aug 29 19:27:58 server-pc exportfs[1623]: exportfs: Failed to stat /mnt/md0/Pictures: No such file or directory
Aug 29 19:27:58 server-pc systemd[1]: nfs-server.service: Control process exited, code=exited status=1
Aug 29 19:27:58 server-pc systemd[1]: nfs-server.service: Failed with result 'exit-code'.
Aug 29 19:27:58 server-pc systemd[1]: Stopped NFS server and services.
At this point, if I get on the server (Mint 19.2) box and issue the command: exportfs -avr .... presto chango, all the clients (that are online) can see the shares and all is well in the universe again. It seems that when the NFS service is starting up, if it can't resolve the hostname or see the network, it completely bombs out and gives up ever working unless you manually intervene.

When I was rolling with Mint 19.1, I used Samba. It was a minor pain to get it completely set up and working perfectly so when I installed a fresh copy of Mint 19.2, I thought I'd go with NFS but now, I think I'm just going to go back to Samba since it would work no matter how many times the server would reboot and clients would ALWAYS be able to access the shares. Samba was just 10,000% more reliable.

What newbie mistake am I making here?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 4 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
ajgringo619

Re: I always thought NFS sharing was superior to Samba but now I'm second guessig that thought

Post by ajgringo619 »

What/where is /mnt/md0?
gene0915
Level 4
Level 4
Posts: 244
Joined: Sun Oct 26, 2014 7:52 pm

Re: I always thought NFS sharing was superior to Samba but now I'm second guessig that thought

Post by gene0915 »

ajgringo619 wrote: Thu Aug 29, 2019 8:57 pm What/where is /mnt/md0?
/mnt/md0 is my main MDADM array on the server where everything is housed (pictures, home movies, etc).
ajgringo619

Re: I always thought NFS sharing was superior to Samba but now I'm second guessig that thought

Post by ajgringo619 »

Check your system messages. I'm betting that this array is being configured after your NFS server is starting up.
gene0915
Level 4
Level 4
Posts: 244
Joined: Sun Oct 26, 2014 7:52 pm

Re: I always thought NFS sharing was superior to Samba but now I'm second guessig that thought

Post by gene0915 »

ajgringo619 wrote: Thu Aug 29, 2019 9:24 pm Check your system messages. I'm betting that this array is being configured after your NFS server is starting up.
I didn't feel like sifting through the log files (REALLY tired.... time for bed :) but I added this to my nfs-server.service file:

Code: Select all

ExecStartPre=/bin/sleep 15
When the server reboots in the morning, I'll check it after I wake up. Maybe the fix will be as simple as just adding that delay?
User avatar
coffee412
Level 8
Level 8
Posts: 2263
Joined: Mon Nov 12, 2012 7:38 pm
Location: I dont know
Contact:

Re: I always thought NFS sharing was superior to Samba but now I'm second guessig that thought

Post by coffee412 »

It appears that your /etc/exports has errors.

Code: Select all

/mnt/md0/pics 192.168.1.1/24(ro,insecure,sync,all_squash,nohide,no_subtree_check,anonuid=1000,anongid=1000)
The above line says "Share with 192.168.1.1 on submask 255.255.255.0 only".

If you want to share with everyone on the local network then do this instead:

Code: Select all

/mnt/md0/pics 192.168.1.0/24 (ro,sync,no_subtree_check)
If you want to share with everyone :

Code: Select all

/mnt/md0/pics *(ro,sync,no_subtree_check)
As for the nfs share options, I would start with a basic simple set of options and then add them one at a time to make sure they are working as you want.

I normally do a

Code: Select all

systemctl nfs-kernel-server restart


to reload nfs.
Ryzen x1800 Asus Prime x370-Pro 32 gigs Ram RX480 graphics
Dell PE T610, Dell PE T710
- List your hardware Profile: inxi -Fxpmrz
MeshCentral * Virtualbox * Debian * InvoiceNinja * NextCloud * Linux since kernel 2.0.36
gene0915
Level 4
Level 4
Posts: 244
Joined: Sun Oct 26, 2014 7:52 pm

Re: I always thought NFS sharing was superior to Samba but now I'm second guessig that thought

Post by gene0915 »

ajgringo619 wrote: Thu Aug 29, 2019 9:24 pm Check your system messages. I'm betting that this array is being configured after your NFS server is starting up.
Good news, adding that delay seems to have fixed it! Thank you!!!!
gene0915
Level 4
Level 4
Posts: 244
Joined: Sun Oct 26, 2014 7:52 pm

Re: I always thought NFS sharing was superior to Samba but now I'm second guessig that thought

Post by gene0915 »

coffee412 wrote: Fri Aug 30, 2019 7:02 am It appears that your /etc/exports has errors.

Code: Select all

/mnt/md0/pics 192.168.1.1/24(ro,insecure,sync,all_squash,nohide,no_subtree_check,anonuid=1000,anongid=1000)
The above line says "Share with 192.168.1.1 on submask 255.255.255.0 only".

If you want to share with everyone on the local network then do this instead:

Code: Select all

/mnt/md0/pics 192.168.1.0/24 (ro,sync,no_subtree_check)
If you want to share with everyone :

Code: Select all

/mnt/md0/pics *(ro,sync,no_subtree_check)
As for the nfs share options, I would start with a basic simple set of options and then add them one at a time to make sure they are working as you want.

I normally do a

Code: Select all

systemctl nfs-kernel-server restart


to reload nfs.
Thanks for the assist but adding the delay to the nfs-server.service seems to have fixed it.
Locked

Return to “Networking”