# NFS mount fails at reboot

**URL:** https://dietpi.com/forum/t/nfs-mount-fails-at-reboot/3952
**Category:** General Discussion
**Created:** [23 March 2020 12:03 UTC](https://dietpi.com/forum/t/nfs-mount-fails-at-reboot/3952 "2020-03-23T12:03:13Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![jonyskids](https://dietpi.com/forum/user_avatar/dietpi.com/jonyskids/32/2056_2.png) [@jonyskids](https://dietpi.com/forum/u/jonyskids)
#### Post date: [23 March 2020 12:03 UTC](https://dietpi.com/forum/t/nfs-mount-fails-at-reboot/3952/1 "2020-03-23T12:03:13Z")

</div>

I have an NFS mount that fails at reboot. If I refresh the Dietpi-drive\_manager shows right up.

Newbie, any help is appreciated.

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [23 March 2020 12:09 UTC](https://dietpi.com/forum/t/nfs-mount-fails-at-reboot/3952/2 "2020-03-23T12:09:13Z")

</div>

what do you mean by “fails at reboot”?? Usually mounts are executed only if you access to folder first time. Means, after reboot the mount is not there. But as soon you enter the folder, it should be remounted.

---

<div class="post-metadata">

### Author: ![jonyskids](https://dietpi.com/forum/user_avatar/dietpi.com/jonyskids/32/2056_2.png) [@jonyskids](https://dietpi.com/forum/u/jonyskids)
#### Post date: [23 March 2020 22:35 UTC](https://dietpi.com/forum/t/nfs-mount-fails-at-reboot/3952/3 "2020-03-23T22:35:10Z")

</div>

When booting it says [FAILED], (in red), Failed to mount…the NFS mount

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [23 March 2020 22:40 UTC](https://dietpi.com/forum/t/nfs-mount-fails-at-reboot/3952/4 "2020-03-23T22:40:54Z")

</div>

did you tried to access the file system after system was booted?

---

<div class="post-metadata">

### Author: ![jonyskids](https://dietpi.com/forum/user_avatar/dietpi.com/jonyskids/32/2056_2.png) [@jonyskids](https://dietpi.com/forum/u/jonyskids)
#### Post date: [23 March 2020 22:51 UTC](https://dietpi.com/forum/t/nfs-mount-fails-at-reboot/3952/5 "2020-03-23T22:51:46Z")

</div>

Yes. I have tried

I can only get there if I go into Dietpi\_Drive\_Manager and do a refresh.

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [23 March 2020 22:54 UTC](https://dietpi.com/forum/t/nfs-mount-fails-at-reboot/3952/6 "2020-03-23T22:54:13Z")

</div>

pls can you have a look into journalctl for available error messages.

---

<div class="post-metadata">

### Author: ![jonyskids](https://dietpi.com/forum/user_avatar/dietpi.com/jonyskids/32/2056_2.png) [@jonyskids](https://dietpi.com/forum/u/jonyskids)
#### Post date: [23 March 2020 23:59 UTC](https://dietpi.com/forum/t/nfs-mount-fails-at-reboot/3952/7 "2020-03-23T23:59:51Z")

</div>

Not sure how much to post?

Mar 23 17:33:44 SkidsPi systemd[1]: mnt-nfs\_SkidsBook.mount: Mount proce  
ss exited, code=exited status=32  
Mar 23 17:33:44 SkidsPi systemd[1]: Failed to mount /mnt/nfs\_SkidsBook.

Mar 23 17:33:44 SkidsPi systemd[1]: mnt-nfs\_SkidsBook.mount: Unit entere  
d failed state.

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [24 March 2020 07:42 UTC](https://dietpi.com/forum/t/nfs-mount-fails-at-reboot/3952/8 "2020-03-24T07:42:28Z")

</div>

hmm honestly I’m wondering why you system is trying to mount the share during boot. Usually this should not happen and the mount should be executed only if you try to access the share. Can you check if the mount is executed before or after an IP address was assigned?

pls can you past as well content of /etc/fstab/

---

<div class="post-metadata">

### Author: ![jonyskids](https://dietpi.com/forum/user_avatar/dietpi.com/jonyskids/32/2056_2.png) [@jonyskids](https://dietpi.com/forum/u/jonyskids)
#### Post date: [26 March 2020 00:57 UTC](https://dietpi.com/forum/t/nfs-mount-fails-at-reboot/3952/9 "2020-03-26T00:57:24Z")

</div>

It tries to mount post trying and then connecting to my VPN via openvpn.  
  
  
  
\

# Please use “dietpi-drive\_manager” to setup mounts

#----------------------------------------------------------------

# NETWORK

#----------------------------------------------------------------  
192.168.2.2:/nfs/Public /mnt/nfs\_SkidsBook nfs auto,\_netdev,nofail 0 0

#----------------------------------------------------------------

# TMPFS

#----------------------------------------------------------------  
tmpfs /tmp tmpfs defaults,size=1023M,noatime,nodev,nosuid,mode=1777 0 0  
tmpfs /DietPi tmpfs defaults,size=10m,noatime,nodev,nosuid,mode=1777 0 0  
tmpfs /var/log tmpfs defaults,size=50m,noatime,nodev,nosuid,mode=1777 0 0

#----------------------------------------------------------------

# MISC: ecryptfs, vboxsf (VirtualBox shared folder), bind mounts

#----------------------------------------------------------------  
  
  
#----------------------------------------------------------------

# SWAPFILE

#----------------------------------------------------------------  
/var/swap none swap sw 0 0

#----------------------------------------------------------------

# PHYSICAL DRIVES

#----------------------------------------------------------------  
PARTUUID=27504eef-02 / ext4 noatime,lazytime,rw 0 1  
PARTUUID=27504eef-01 /boot vfat noatime,lazytime,rw 0 2  
UUID=64dce9c8-bb04-4c78-9d5b-2abb52e1a5ab /mnt/64dce9c8-bb04-4c78-9d5b-2abb52e1a5ab ext4 noatime,lazytime,rw,nofail,noauto,x-systemd.automount

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [26 March 2020 08:27 UTC](https://dietpi.com/forum/t/nfs-mount-fails-at-reboot/3952/10 "2020-03-26T08:27:36Z")

</div>

ok I setup a small test environment with NFS Server and Client. Looks like the NFS mount is done before the network interface is online. Therefore the mount failed. I found a small workaround to have it fixed. for this you would need to adjust /etc/fstab and replace your network mount with the following line

```nohighlight
192.168.2.2:/nfs/Public /mnt/nfs_SkidsBook nfs _netdev,nofail,noauto,x-systemd.automount 0 0

```

Now your system will not go to mount the NFS share during boot anymore. This only will happen as soon as someone is trying to access the share.

---

<div class="post-metadata">

### Author: ![trendy](https://dietpi.com/forum/user_avatar/dietpi.com/trendy/32/61_2.png) [@trendy](https://dietpi.com/forum/u/trendy)
#### Post date: [26 March 2020 09:20 UTC](https://dietpi.com/forum/t/nfs-mount-fails-at-reboot/3952/11 "2020-03-26T09:20:27Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [26 March 2020 09:34 UTC](https://dietpi.com/forum/t/nfs-mount-fails-at-reboot/3952/12 "2020-03-26T09:34:00Z")

</div>

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.

```nohighlight
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.

```nohighlight
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:~#

```

---

<div class="post-metadata">

### Author: ![trendy](https://dietpi.com/forum/user_avatar/dietpi.com/trendy/32/61_2.png) [@trendy](https://dietpi.com/forum/u/trendy)
#### Post date: [26 March 2020 10:11 UTC](https://dietpi.com/forum/t/nfs-mount-fails-at-reboot/3952/13 "2020-03-26T10:11:59Z")

</div>

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.

```nohighlight
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 --

```

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [26 March 2020 11:03 UTC](https://dietpi.com/forum/t/nfs-mount-fails-at-reboot/3952/14 "2020-03-26T11:03:14Z")

</div>

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

```nohighlight
-- No entries --

```

---

<div class="post-metadata">

### Author: ![trendy](https://dietpi.com/forum/user_avatar/dietpi.com/trendy/32/61_2.png) [@trendy](https://dietpi.com/forum/u/trendy)
#### Post date: [26 March 2020 11:38 UTC](https://dietpi.com/forum/t/nfs-mount-fails-at-reboot/3952/15 "2020-03-26T11:38:03Z")

</div>

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!

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [26 March 2020 12:05 UTC](https://dietpi.com/forum/t/nfs-mount-fails-at-reboot/3952/16 "2020-03-26T12:05:08Z")

</div>

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

[https://github.com/MichaIng/DietPi/issues/1898](https://github.com/MichaIng/DietPi/issues/1898)

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [26 March 2020 13:22 UTC](https://dietpi.com/forum/t/nfs-mount-fails-at-reboot/3952/17 "2020-03-26T13:22:28Z")

</div>

Guys,

a permanent fix will be provided with v6.29.

---

<div class="post-metadata">

### Author: ![jonyskids](https://dietpi.com/forum/user_avatar/dietpi.com/jonyskids/32/2056_2.png) [@jonyskids](https://dietpi.com/forum/u/jonyskids)
#### Post date: [26 March 2020 16:39 UTC](https://dietpi.com/forum/t/nfs-mount-fails-at-reboot/3952/18 "2020-03-26T16:39:17Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [26 March 2020 21:20 UTC](https://dietpi.com/forum/t/nfs-mount-fails-at-reboot/3952/19 "2020-03-26T21:20:26Z")

</div>

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

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [28 March 2020 10:34 UTC](https://dietpi.com/forum/t/nfs-mount-fails-at-reboot/3952/20 "2020-03-28T10:34:29Z")

</div>

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.
