fstab not mounting automatically
This is in /etc/fstab:
private.ip:/var/www/dir /var/www/dir2 nfs rw,sync 0 0
This manual command works fine:
mount private.ip:/var/www/dir /var/www/dir2
I can't see an error, but it's not working. Any help or suggestions would be greatly appreciated.
Thanks
6 Replies
private.ip:/var/www/dir /var/www/dir2 nfs rw,addr=private.ip 0 0
I entered that into fstab, but still no mount after a reboot.
Thanks
3. /etc/init.d/networking runs at startup, and uses "ifup -a" to enable automatic networking interfaces.
Any interfaces defined in /etc/network/interfaces as "auto" are enabled. Assuming they come up properly, scripts in /etc/network/if-up.d are executed. That directory should include a mountnfs script.
The mountnfs exits early unless it is running for the final interface (e.g., all interfaces are now up).
The mountnfs script scans /etc/fstab for nfs mounts (as long as they aren't marked "noauto") and will also try to start portmap and statd unless you have "nolock" specified.
The actual mount is performed through "mount -a -txxx" where xxx is the mount fs type from fstab (e.g., "nfs" or "nfsv4").
So I guess a few simple things to try would be:
- 3. Does "mount -a -tnfs" work manually after boot? (E.g., let mount use the fstab entry rather than a full command line)
Does your private interface come up automatically or do you normally do that through some other mechanism post-boot? Typically this will be a static entry within your /etc/network/interfaces, but you'll still want to mark it auto. Otherwise the mountnfs script might run before the private interface is operational.
There should also be some logs from the mountnfs script if it's skipping things, but I'm not absolutely sure where they'll end up. I'd certainly check for any nfs references in any /var/log/*.log files.
If nothing else, you could add some debugging logs to some of the scripts to get an idea of just what happens at boot time if it's still unclear what isn't running.
– David
Yes, the command "mount -a -tnfs" works fine manually.
My interfaces are set to auto :auto eth0 eth0:0 eth0:1 and come up automatically after reboot.
I'm not seeing anything in the logs to indicate a problem (although, truthfully, I may not recognize it if I saw it).
And yes, /etc/network/if-up.d contains a mountnfs script.
Suggestions?
@cap:
Suggestions?
It sounds like things should be working. Certainly since the mount -a -tnfs works, as long as you don't have "noauto" in the fstab entry then that part of things should be fine.
It does seem a little odd to have three interfaces though on a Linode (eth0, eth0:0 and eth0:1)? Typically eth0 would be your main interface, and the private interface would be a single alias (e.g., you'd only have one of eth0:0 or eth0:1). Any chance that one of those isn't becoming fully active? If so, then mountnfs would not execute since it would never see all "auto" interfaces as up. It checks by looking in /etc/run/network/ifstate (or perhaps /var/run depending on Debian release). But in that case you should see some messages from mountnfs for the initial interfaces where it's waiting to do the mounts. Actually since you have more than one interface you should always get at least one of those messages, so if you aren't, it might be an indication that mountnfs is never running at all for some reason. Not sure if the message gets logged to a file or just shows up on the console during boot, so you may also wish to watch console messages through LISH.
If you're not seeing any nfs related messages anywhere, I guess if I were you I'd temporarily add some logging messages to perhaps the main /etc/init.d/networking (where it's calling ifup -a during start processing), and perhaps throw the "-v" option onto ifup for logging the things its executing, and probably inside the mountnfs script at a few points such as where it identifies the filesystems to mount, and where it executes the actual mount operation.
Basically try to identify at what stage the expected sequence of events is not taking place.
My guess is that in the end it'll become obvious what is the missing piece (or what step is silently failing).
– David
When I removed that, everything works great!
Thanks again for your help. You just saved me a ton of aggravation.
Thanks