Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have the following in /etc/fstab on FreeBSD:

venture:/usr/redacted    /usr/local/redacted   nfs     rw      0       0

This fails during boot. However, after boot, the following command succeeds

mount -t nfs venture:/usr/redacted /usr/local/redacted

Two related questions:

1) last time I rebooted at the console (this machine is in a datacenter), I'm pretty sure I saw an explanatory message at boot time regarding the failure to mount. I think it had something to do with resolving the hostname. However, this message does not appear in /var/log/messages with other boot-time messages; is there someplace else I should be looking?

2) Any thoughts about what could be preventing the hostname from resolving at boot time, but no problem 30 seconds later from the command prompt?

share|improve this question
3  
Maybe its trying to mount before a local name service of some sort is up? (Local DNS server, etc.) – derobert Mar 8 '13 at 18:39
    
Heh. Good thought. I was going to respond that "venture" is in the hosts file, but I checked and, no, it isn't. The local DNS server is dnscache, started by svscan late in the boot process, so I bet that's the problem. I'm adding venture to the hosts file for now and we'll see after next reboot whether that fixes the problem. Meanwhile, I'm still interested in an answer (if there is one) to my logging question. – davidcl Mar 8 '13 at 19:17
1  
No thoughts on the logging issue. I just think that a better solution to your mount failure problem is to start the nfs client after any networking services. Worked for me in the past... If that isn't an option, a dirty workaround that also helped me before is to add this to your /etc/rc.local: mountpoint /usr/redacted || mount /usr/redacted – Joseph R. Mar 8 '13 at 21:44
    
@Joseph R: I'm not sure how to make a system service in /etc/rc.d start after a local service in /usr/local/etc/rc.d – davidcl Mar 8 '13 at 22:16
    
Which version of FreeBSD are you using? – Carpetsmoker Mar 9 '13 at 23:34

This might help, my etc/fstab looks like this for FreeBSD 9.1

/dev/gpt/swap0  none    swap    sw  0   0
tmpfs   /tmp    tmpfs   rw,size=228608000   0   0
linproc /compat/linux/proc  linprocfs   rw  0   0

192.168.1.15:/Network/distfiles /usr/ports/distfiles nfs rw,tcp,intr,noatime,nfsv3,wsize=262144,rsize=262144 0 0
192.168.1.15:/Network/packages /Network/packages nfs rw,tcp,intr,noatime,nfsv3,wsize=262144,rsize=262144 0 0
192.168.1.15:/Network/tv /Network/tv nfs rw,tcp,intr,noatime,nfsv3,wsize=262144,rsize=262144 0 0
192.168.1.15:/Network/iso /Network/iso nfs rw,tcp,intr,noatime,nfsv3,wsize=262144,rsize=262144 0 0
192.168.1.15:/Network/wow /Network/wow nfs rw,tcp,intr,noatime,nfsv3,wsize=262144,rsize=262144 0 0
192.168.1.15:/Network/music /Network/music nfs rw,tcp,intr,noatime,nfsv3,wsize=262144,rsize=262144 0 0
192.168.1.15:/Network/public /Network/public nfs rw,tcp,intr,noatime,nfsv3,wsize=262144,rsize=262144 0 0
192.168.1.15:/Network/home/sfourman /Network/home/sfourman nfs rw,tcp,intr,noatime,nfsv3,wsize=262144,rsize=262144 0 0
192.168.1.15:/Network/home/fourmannetworks /Network/home/fourmannetworks nfs rw,tcp,intr,noatime,nfsv3,wsize=262144,rsize=262144 0 0
share|improve this answer
1  
I am not sure if this really answers the question. Can you maybe elaborate a bit on how this answers the question? – Bernhard Apr 5 '13 at 17:47

I had several servers that showed the same behavior, network/local resolvers not started when the NFS mount is being accessed. The solution was changing service start. Not sure about freebsd, but that should give you a starting point.

share|improve this answer

You can check kernel messages. In centOS or redhat, these logs are located in /var/log/dmesg.

It may happen that during boot, before network services are up, server is trying to boot NFS storage and it is unable to resolve remote host.

You can also check by changing start time of NFS service at last.

share|improve this answer

You can try looking in /var/log/boot.msg and boot.msg, they will contain the text you see on the screen while booting up.

My guess is it might have something to do with runlevel 3 versus runlevel 5, and that you might be trying to nfs mount something listed in the /etc/fstab file before all other required services have been started.

Instead of using the hostname venture in /etc/fstab you can try using it's ip address instead. That would quickly verify it is a hostname or dns lookup problem. You might be able to fix this by adding venture and it's ip address in /etc/hosts, but that would only work if you know venture won't have its ip address by dhcp.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.