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

Connection sharing, Firewall, Samba..etc
Forum rules
Before you post please read how to get help
Post Reply
gene0915
Level 4
Level 4
Posts: 209
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 » Thu Aug 29, 2019 8:34 pm

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 gene0915 on Fri Aug 30, 2019 11:17 am, edited 3 times in total.

ajgringo619
Level 6
Level 6
Posts: 1386
Joined: Thu Mar 01, 2018 8:36 pm
Location: San Diego, California

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

Post by ajgringo619 » Thu Aug 29, 2019 8:57 pm

What/where is /mnt/md0?
Mint 19.2 XFCE
kernel 4.15.0-64-generic
AMD FX-8350 Eight-Core w/16 GB RAM
Nvidia GeForce 960 w/2GB RAM (435.21)
Image

gene0915
Level 4
Level 4
Posts: 209
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 » Thu Aug 29, 2019 9:00 pm

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
Level 6
Level 6
Posts: 1386
Joined: Thu Mar 01, 2018 8:36 pm
Location: San Diego, California

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

Post by ajgringo619 » 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.
Mint 19.2 XFCE
kernel 4.15.0-64-generic
AMD FX-8350 Eight-Core w/16 GB RAM
Nvidia GeForce 960 w/2GB RAM (435.21)
Image

gene0915
Level 4
Level 4
Posts: 209
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 » Thu Aug 29, 2019 11:41 pm

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 5
Level 5
Posts: 964
Joined: Mon Nov 12, 2012 7:38 pm
Location: Indiana, USA
Contact:

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

Post by coffee412 » 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.
Ryzen x1800 Asus Prime x370-Pro 32 gigs Ram RX480 graphics
IceWarp 12.0.3 * Mint 18.3 * RAID 1/5 * OpenVPN * Linux since kernel 2.0.36
************* Get Your Linux on! ***************

gene0915
Level 4
Level 4
Posts: 209
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 » Fri Aug 30, 2019 11:13 am

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: 209
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 » Fri Aug 30, 2019 11:15 am

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.

Post Reply

Return to “Other networking topics”