NFS mount fails at reboot Topic is solved

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
trendy
Posts: 119
Joined: Tue Feb 25, 2020 2: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: 2044
Joined: Sat Nov 16, 2019 12:49 am

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

root@DietPi3:~# 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

root@DietPi3:~# 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.
root@DietPi3:~#
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
trendy
Posts: 119
Joined: Tue Feb 25, 2020 2: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

dietpi@raspi:[~]$ 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: 2044
Joined: Sat Nov 16, 2019 12:49 am

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 --
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
trendy
Posts: 119
Joined: Tue Feb 25, 2020 2: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: 2044
Joined: Sat Nov 16, 2019 12:49 am

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
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
Joulinar
Posts: 2044
Joined: Sat Nov 16, 2019 12:49 am

Re: NFS mount fails at reboot

Post by Joulinar »

Guys,

a permanent fix will be provided with v6.29.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
jonyskids
Posts: 13
Joined: Thu Nov 16, 2017 3: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: 2044
Joined: Sat Nov 16, 2019 12:49 am

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.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
MichaIng
Site Admin
Posts: 2293
Joined: Sat Nov 18, 2017 6: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