NFS mount fails at reboot Topic is solved

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
trendy
Posts: 52
Joined: Tue Feb 25, 2020 1:54 pm

Re: NFS mount fails at reboot

Post by trendy »

It's quite interesting that on 3 of my DietPis, I have different options in fstab for the nfs. They all are in v6.28 amd fully updated.
Raspi3B and Odroid C1 have `auto,_netdev,nofail`
Rockpi4 has `_netdev,nofail,noauto,x-systemd.automount`
None of them is using the dump and fsck numbers at the end.
Nonetheless they all work fine, but I guess there was some change at some point in the releases.

User avatar
Joulinar
Posts: 713
Joined: Fri Nov 15, 2019 11:49 pm

Re: NFS mount fails at reboot

Post by Joulinar »

@trendy

I guess it has something to do with using STATIC or DHCP IP address.

If I'm using DHCP, NFS mount is failing during boot.

Code: Select all

[email protected]:~# journalctl -u mnt-nfs_client.mount
-- Logs begin at Thu 2019-02-14 11:11:58 CET, end at Thu 2020-03-26 10:11:41 CET. --
Mär 26 10:10:42 DietPi3 systemd[1]: Mounting /mnt/nfs_client...
Mär 26 10:10:42 DietPi3 mount[427]: mount.nfs: Network is unreachable
Mär 26 10:10:42 DietPi3 systemd[1]: mnt-nfs_client.mount: Mount process exited, code=exited, status=32/n/a
Mär 26 10:10:42 DietPi3 systemd[1]: mnt-nfs_client.mount: Failed with result 'exit-code'.
Mär 26 10:10:42 DietPi3 systemd[1]: Failed to mount /mnt/nfs_client.
But if I switch to STATIC IP, the NFS mount will succeed.

Code: Select all

[email protected]:~# journalctl -u mnt-nfs_client.mount
-- Logs begin at Thu 2019-02-14 11:11:58 CET, end at Thu 2020-03-26 10:31:22 CET. --
Mär 26 10:30:46 DietPi3 systemd[1]: Mounting /mnt/nfs_client...
Mär 26 10:30:47 DietPi3 systemd[1]: Mounted /mnt/nfs_client.
[email protected]:~#

trendy
Posts: 52
Joined: Tue Feb 25, 2020 1:54 pm

Re: NFS mount fails at reboot

Post by trendy »

I am using dhcp on all 3 of them.
I rebooted the Raspi3B which has options `auto,_netdev,nofail` and the mount is available immediately.

Code: Select all

[email protected]:[~]$ sudo journalctl -u mnt-nfs_client.mount
-- Logs begin at Thu 2020-03-26 11:09:30 CET, end at Thu 2020-03-26 11:11:13 CET. --
-- No entries --

User avatar
Joulinar
Posts: 713
Joined: Fri Nov 15, 2019 11:49 pm

Re: NFS mount fails at reboot

Post by Joulinar »

can you have a look to journalctl to see at which stage the nfs mount is done? Because on my test system 3B+ it's done right in the middle of assigned an IP address via DHCP. So for sure the NFS will fail without eth0 up.

btw: @trendy

you provided an empty journalctl -u mnt-nfs_client.mount code snip. So I guess your mount point is different than /mnt/nfs_client

Code: Select all

-- No entries --

trendy
Posts: 52
Joined: Tue Feb 25, 2020 1:54 pm

Re: NFS mount fails at reboot

Post by trendy »

Yes, it is /mnt/backup and you are right about it. The mount is happening before the dhcp transaction starts, hence it fails. The automated backup kept taking snapshots though and there was something inside the directory, thus my confusion.
I corrected the nfs mount line in fstab and now works properly! Thanks!

User avatar
Joulinar
Posts: 713
Joined: Fri Nov 15, 2019 11:49 pm

Re: NFS mount fails at reboot

Post by Joulinar »

I added the topic to an old GitHub entry. Let's see what @MichaIng thinks on it.

https://github.com/MichaIng/DietPi/issues/1898

User avatar
Joulinar
Posts: 713
Joined: Fri Nov 15, 2019 11:49 pm

Re: NFS mount fails at reboot

Post by Joulinar »

Guys,

a permanent fix will be provided with v6.29.

jonyskids
Posts: 6
Joined: Thu Nov 16, 2017 2:21 pm

Re: NFS mount fails at reboot

Post by jonyskids »

That did it, Thanks.

Will that be permanent if I use the drive_manager to add more drives?

Really Appreciate the help. This has been a glitch for some time.

User avatar
Joulinar
Posts: 713
Joined: Fri Nov 15, 2019 11:49 pm

Re: NFS mount fails at reboot

Post by Joulinar »

usually it should, at least if you did not touch this mount. Anyway it will be fixed permanently with upcoming DietPi release.

User avatar
MichaIng
Site Admin
Posts: 2095
Joined: Sat Nov 18, 2017 5:21 pm

Re: NFS mount fails at reboot

Post by MichaIng »

Yes, fstab changes for network drives are permanent, only physical drive mounts are rewritten when you open dietpi-drive_manager.
And yes I fixed it for next DietPi release, thanks to your report! We already added this fix for NFS pre-v3 and Samba for simply missed the code lines that are responsible for NFSv3 which requires a slightly different fstab entry.

Post Reply