Nfs not mounting on boot

I am easily confused. I have two computers running Manjaro with KDE Plasma. One is a MS Surface Pro 3, the other is a Lenovo ideapad 330.

They both use NFS to connect to the same server, using the same fstab entries, mount points, and options. Connections work fine, once they are mounted.

Problem is, the Lenovo mounts during the boot process, and the Surface Pro never mounts during the boot process.

Looking in the Surface Pro
sudo journalctl -b
it looks as if NFS fails to mount before WIFI is connected.

sudo dmesg | pgr stars
[ 5.123898] systemd-fstab-generator[185]: Checking was requested for "stars-end:/mnt/extras", but it is not a device.

I can manually mount the filesystem on the Surface Pro, and it works (mostly). I can also add a line to /etc/rc.local (mount -a).

Why would one system work differently from the other?

Is this question a concept question with no real answer, or a configuration issue I can fix?

If it’s a config issue, I can post output from whatever commands are required.

I get the idea RTFM, but one would have to understand all the arcane terminology to learn from the manual. Which is why we have experts, and me.

I have tried to use systemd mount units. Created the file, mnt-stars.mount

sudo systemctl daemon-reload
systemctl enable mnt-stars.mount
sudo systemctl start mnt-stars.mount

This works, but on reboot the nfs filesystem is not mounted. Did I mess a step?

Also, adding mount -a to /etc/rc.local had me creating the rc.local file. I have since read that using this file is deprecated, which I suppose is why I didn’t have one. It did not do anything either.

Those are likely where the issue is.

I have no experience with either nfs nor with systemd mount units, but I have often read here that it is preferred to use the latter to define nfs mounts because systemd can then make sure that the network is up when the mount is attempted.

You should probably use the search function and look for posts or even wikis that discuss systemd mount units and nfs. :man_shrugging:

I tested with /etc/fstab, connecting to my RPI4. Manual way has always worked but at boot-time…eh.

Found this to work: x-systemd.automount
Add that to mounting options. Try the others too if that doesn’t solve it.

To find out what errors out, check last post here: SOLVED - NFS share doesn't mount at boot | TrueNAS Community
sudo systemctl -t mount
Find something that references your nfs share. Mine was called ‘mnt-nfsshare.mount’
Then do:
sudo journalctl -u NameYouFoundAbove
In my case: sudo journalctl -u mnt-nfsshare.mount

I got a ‘Network unreachable’. RPI4 is on all the time so it can’t be that. PC must be trying to mount before network is up or something.

My fstab-entry NOW looks like this:
RPI-IPaddress:/mnt/nfsshare /mnt/nfsshare nfs4 x-systemd.automount,timeo=10,retrans=5,_netdev,hard,intr,noexec,nosuid,tcp 0 0

If that helps any.

The solution was to add to my fstab entries.

Truly a lot of research and failed attempts to get something working as simple as mounting an nfs share. No tricks required on machine A, full on circus on machine B.

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.