Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Free Guide: Linux from Scratch
Linux from Scratch describes the process of creating your own Linux system from scratch from an already installed Linux distribution, using nothing but the source code of software that you need.
This 318 page eBook provides readers with the background and instruction to design and build custom Linux systems. The resulting system will be compiled completely from the source code, and the user will be able to specify where, why, and how programs are installed. This eBook allows readers to fully customize Linux systems to their own needs and allows users more control over their system.
Click Here to receive the Linux from Scratch Guide absolutely free.
Hello,
I have a small network of two linux computers.
I can ping and ssh: It works very well.
I have nfs running, and I would like to mount the other computer's filesystem.
I have this line in /etc/fstab :
I did check the logs, and have now rechecked them: No obvious complaints visible in either /var/log/messages or from dmesg, except for "xinetd[2158]: warning: can't get client address: Transport endpoint is not connected". Is this relevant? If you like, I'll post the files, but they are quite l-o-n-g!
Looking at both the above, it seems to me that it is mounting my local partitions before it is finding my network card, loading the module for it, and starting up the network. Maybe whatever it is that runs through fstab and mounts things doesn't mount the network drive as the network isn't up by then? But nothing is complaining, and when I mount the networked drive manually, it just mounts as it should.
It is the MDK9.1 2.4 kernel machine that is badly behaved, the MDK10.1 2.6 kernel machine behaves as expected and mounts the other computer's drives at boot time. I don't suppose it should be a problem to have both PCs being both nfs servers and clients?
Looking at both the above, it seems to me that it is mounting my local partitions before it is finding my network card, loading the module for it, and starting up the network. Maybe whatever it is that runs through fstab and mounts things doesn't mount the network drive as the network isn't up by then?
I think you have found the problem: You can't mount NFS filesystems before the hardware is initialized. On my SUSE system, this is solved by a runlevel script that runs after network initialization. I can post script if you don't find something similar on your system.
Originally posted by abisko00 I think you have found the problem: You can't mount NFS filesystems before the hardware is initialized. On my SUSE system, this is solved by a runlevel script that runs after network initialization. I can post script if you don't find something similar on your system.
I am now getting exactly the same problem as tredegar, I am using a Red Hat 9 system.
I can mount the nfs filesystem with mount -t nfs.... command, but not in fstab.
I believe the hardware isn't initialized when the system trying to mount the nfs filesystem.
Would you mind shairing your runlevel script to us?
(I don't want to mount the nfs filesystem with rc.local...)
SUSE may have a different structure than RH9, so you probably need to adjust the script:
Code:
#! /bin/bash
# Copyright (c) 1996-2002 SuSE Linux AG, Nuernberg, Germany.
# All rights reserved.
#
# Author: Florian La Roche, 1996
# Werner Fink <werner@suse.de>, 1996
# Burchard Steinbild, 1996
#
# Please send feedback to http://www.suse.de/feedback
#
# /etc/init.d/nfs
#
### BEGIN INIT INFO
# Provides: nfs
# Required-Start: $network $portmap
# Required-Stop:
# X-UnitedLinux-Should-Start:
# X-UnitedLinux-Should-Stop:
# Default-Start: 3 5
# Default-Stop:
# Description: Imports remote Network File Systems (NFS)
### END INIT INFO
. /etc/rc.status
nfs=no
while read where what type options rest ; do
case "$where" in
\#*|"") ;;
*) if test "$type" = "nfs" ; then
nfs=yes
break
fi ;;
esac
done < /etc/fstab
rc_reset
case "$1" in
start|reload)
echo -n "Importing Net File System (NFS)"
if test "$nfs" = yes ; then
# Mount all auto NFS devices (-> nfs(5) and mount(8) )
# NFS-Server sometime not reachable during boot phase.
# It's sometime usefull to mount NFS devices in
# background with an ampersand (&) and a sleep time of
# two or more seconds, e.g:
#
# sleep 2 && mount -at nfs &
# sleep 2
#
# Note: Some people importing the /usr partition.
# Therefore we do _NOT_ use an ampersand!
#
mount -at nfs
rc_status
sleep 1
#
# generate new list of available shared libraries
#
ldconfig -X 2>/dev/null
rc_status -v
else
rc_status -u
fi
;;
stop)
echo -n "Remove Net File System (NFS)"
if test "$nfs" = "yes" ; then
#
# Unmount in background because during long timeouts
#
umount -at nfs &
sleep 2
rc_status -v
else
rc_status -u
fi
;;
restart|force-reload)
## Stop the service and regardless of whether it was
## running or not, start it again.
$0 stop
$0 start
rc_status
;;
status)
echo -n "Checking for mounted nfs shares (from /etc/fstab):"
if test "$nfs" = "yes" ; then
while read where what type options rest ; do
case "$where" in
\#*|"") ;;
*) case "$options" in
*noauto*) ;;
*) if test "$type" = "nfs" ; then
grep -q "$where $what nfs" /proc/mounts || rc_failed 3
fi ;;
esac
esac
done < /etc/fstab
else
rc_failed 3
fi
rc_status -v
;;
try-restart|condrestart)
$0 status
if test $? = 0; then
$0 restart
else
rc_reset
fi
rc_status
;;
*)
echo "Usage: $0 {start|stop|status|reload|force-reload|restart|try-restart}"
exit 1
esac
rc_exit
Apologies if I am missing important details - I am very new at this.
I am trying to mount a windows network share on boot, with little luck. Mounting manually (with mount -t) works fine, so I added a line to fstab. Forcing a remount with mount -a also works fine (although there is an odd error "[mntent]: warning: no final newline at the end of /etc/fstab")
However, when I reboot, the network share does not mount.
I tried adding "sudo mount -a" to rc.local, but no improvement.
Oddly, I was intending to use smb4k, but although the "remount on restart" option was selected, it also failed on reboot!
I like the explanation of not being able to mount until the network has started up, but that does not explain the failure of rc.local, right?
If nothing else, could someone please advise on what logs to check for messages?
Thank you in advance for your help!
----------------------------
Oops - I see I have this in the wrong forum. My apologies - please delete.
(although there is an odd error "[mntent]: warning: no final newline at the end of /etc/fstab")
That error means exactly what it says, that fstab should end with a <Return>, but it's not fatal. Just add a blank like at the end of fstab to get rid of that error.
Quote:
I tried adding "sudo mount -a" to rc.local, but no improvement.
rc.local is run as root, so you do not need the sudo
You say you can mount your network drive with mount -tblah blah blah, so I'd suggest you just put that mount command at the end of rc.local and it'll probably work for you.
And welcome to LQ
I've had the same problem with my nfs shares not mounting at boot. (Had to manually mount).
In looking at /var/log/messages I found "link beat not detected". The NIC was working though. I could browse the internet.
I disabled my MCP51 ethernet controller, (Nvidia using the forcedeth module), and fired up my ADM983 Linksys card with tulip....Rebooted, and the nfs share was sitting on the desktop.
Thank you all for the quick response, and the welcome!
True to form I did find the solution, much later last night. I did not end up needing to modify rc.local, although I am sure the proposed solution above would have worked.
The (for me) ideal solution was found elsewhere in the forum. The suggestion was to use the _netdev modifier in the fstab statement. This forces the mount operation to wait until the network connection is up and running. It worked a charm.
For future noob (like me!) reference the correct use is:
Yes, I know the guest authentication sucks, but this is for a windows share which defaults to no authentication required, and all of this is behind a firewall so I am not too worried. As my bravery increases I may fix it later.
Thank you all again. I am VERY sure I will be back!!!!
I am having a similar problem with being able to mount nfs shares manually but not via fstab. For me, it isn't an issue related to hardware initialization. I'm not sure what the problem is, but you can see my full description here: http://www.linuxquestions.org/questi...y-help-631772/
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.