# FreeBSD trying to mount before bce0 comes up



## Jayuqo (Apr 27, 2011)

Good day,

Why would FreeBSD try to mount what's in the fstab before the NIC interface (bce0) comes up? When it happens, it takes me to single user mode and I just type *mount -a* and it mounts my external points because bce0 is now up at this point. I tried it v8.1 with a Dell 1950 and a R610 but same problem.

Is there any way you can force fstab to try to mount only if bce0 comes up first? Can you tell it to retry at the end of the boot process? Or can you get bce0 to come up before everything else?

Thanks
Jay


----------



## shitson (Apr 27, 2011)

Are you trying to mount an NFS/SMB share?

This won't work, you need fstab to mount your file systems first, otherwise you won't have an Operating System/Network stack to initialize. I would set your mounts to noauto in fstab and have a script later in the boot to mount them (maybe a shell script) which is able to check for the existence of a. a network connection b. access to the remote server.


----------



## DutchDaemon (Apr 27, 2011)

Set the nfs filesystems to 'late' (mount(8) / fstab(5)). If you get your IP address from DHCP, also set it to SYNCDHCP in /etc/rc.conf.


----------



## Jayuqo (Apr 27, 2011)

It tries to mount a shared folder sitting on another server using NFS.

I basically install FreeBSD and I update the ports using the file server (NFS mount)


----------



## SirDice (Apr 28, 2011)

Jayuqo said:
			
		

> It tries to mount a shared folder sitting on another server using NFS.
> 
> I basically install FreeBSD and I update the ports using the file server (NFS mount)



See DutchDaemon's solution.


----------



## Jayuqo (Apr 29, 2011)

So the "late" and "SYNCDHCP" worked fine but I'm still having problem with one of my server with a static IP address. Basically, it will try to mount before the network interface comes up. Is there an equivalent of "SYNCDHCP" for static IP?

Thanks


----------



## SirDice (Apr 29, 2011)

Use the late mount option.


----------



## mlager (May 1, 2011)

I had the same problem with certain services not starting because bce0 wasn't up yet. So I interjected a 10 second sleep in /etc/rc.d/netif. I'm not certain this would solve your problem due to the fstab being processed before netif, but the noauto flag and a new RC script that requires networking sounds like it would work well, maybe in conjunction with the sleep in netif. Just a thought.


----------



## Jayuqo (May 5, 2011)

So here's what I got in the /etc/fstab:


```
mountpoint1:/ifs/home     /home      nfs    rw,tcp,late     0    0
mountpoint2:/ifs/data     /data      nfs    rw,tcp,late     0    0
```

The address is statically assigned and yet, the NIC comes up after it tries to mount which causes the system to go in single-user mode. Any ideas?


----------



## phoenix (May 5, 2011)

Search the forums for */etc/rc.d/defaultroute* for your solution.


----------



## Jayuqo (May 6, 2011)

Problem fixed! I did what you told me and I found that post http://forums.freebsd.org/showthread.php?p=132749&highlight=%2Frc.d%2Fdefaultroute#post132749

Since I'm running 8.2, I looked up Jeremy Chadwick's script and I followed the "readme" and it fixed my problem when having an IP statically assigned.

http://lists.freebsd.org/pipermail/freebsd-rc/2010-September/002060.html


----------

