Remote FS doesn't mount on boot if fqdn is in use

Hello,

I've been trying to make FreeBSD mount following entry in /etc/fstab on boot:
Code:
nfs.domain:/spool                /nfspool        nfs     rw,bg,noatime   0 0

It doesnt work until I use IP like this:
Code:
10.6.0.1:/spool                /nfspool        nfs     rw,bg,noatime   0 0

host nfs.domain gives 10.6.0.1 and mount -t nfs nfs.domain /spool works just fine. I'm pretty sure that putting nfs.domain in /etc/hosts will do either.

As said at https://www.freebsd.org/doc/handbook/network-nfs.html there is
Code:
nfs_client_enable="YES"
in my /etc/rc.conf.

There is not much of this in the net, but there is an opinion I stumble upon, that one should use IP addresses always, when it comes to an NFS.
IMHO it's not convenient and seems like a bug for me (or some sort of architectural design, that's not allowing to resolve fqdn to IP while booting). Is there a solution to use fqdn and not IP and have nfs mounted at boot?

Thanks.
 
Try adding the late option. That will cause it to be mounted much later during the boot process.

There is not much of this in the net, but there is an opinion I stumble upon, that one should use IP addresses always, when it comes to an NFS.
I've really only ever used IP addresses. Mainly to prevent issues like this. It should work though, provided name resolving works correctly. It will add a slight delay though, as it needs to resolve the hostname before it's able to mount the filesystem. Are there any errors in /var/log/messages? Something like not being able to resolve or not able to connect?

The nfs_client_enable shouldn't be needed but won't hurt or cause issues. As soon as the system figures out it's an NFS share it needs to mount the appropriate services will get started automatically.
 
Put nfs.domain into /etc/hosts and it should work. The problem is that DNS resolution may not be available at the time the system is configuring the NFS mounts.

Code:
10.6.0.1 nfs.domain nfs

Edit: Definitely try the late option as well, this should defer the mounting until DNS is available.
 
No messages related to nfs or name resolution pops up or in /var/run/dmesg.boot or /var/log/messages, but:
Code:
rpc.umntall: nfs.domain: MOUNTPROG: RPC: Unknown host
Mounting late file systems:mount_nfs: nfs00.profile.rambler.ru: hostname nor servname provided, or not known
.
pops in console. I have to use set console=vidconsole at boot prompt to see it.
late option makes server to end up in single mode while boot and adds the following to the output in console:
Code:
Mounting /ets/fstab filesystems failed, startup aborted
ERROR: ABORTING BOOT (sending SIGTERM to parent)!
date host init: /bin/sh on /etc/rc terminated abnormally, going to single user mode
 
late option makes server to end up in single mode while boot and adds the following to the output in console:
Code:
Mounting /ets/fstab filesystems failed, startup aborted
ERROR: ABORTING BOOT (sending SIGTERM to parent)!
date host init: /bin/sh on /etc/rc terminated abnormally, going to single user mode
That probably means you've added it incorrectly. Can you show us how you added it?
 
Back
Top