Hi All,
On a fully up-to-date F16 system (as of this morning) I have an issue with remote mounting directories at boot. The machine's /etc/fstab contains these two lines:
purse:/share /share nfs rw,rsize=8192,wsize=8192,timeo=14,intr,addr=192.168.1.10 0 0 mirror:/home /home nfs nfsvers=3,rw,rsize=8192,wsize=8192,timeo=14,intr,addr=192.168.1.1 0 0
The first, to an F6 machine, always works. The second, to an F14 machine never works at boot time, but always works with 'mount -a' done later in a root (text) login session or 'su' time.
How can I get this to work without manual intervention?
Jonathan
On Thu, 17 May 2012 11:08:08 +0100 Jonathan Allen wrote:
How can I get this to work without manual intervention?
Personally, I use a script in rc.local that checks /proc/mount against /etc/fstab and tries to mount anything that isn't already mounted - it is the only way I've found to make network mounts reliable. Seems hit or miss otherwise.
Tom Horsley wrote:
Personally, I use a script in rc.local that checks /proc/mount against /etc/fstab and tries to mount anything that isn't already mounted - it is the only way I've found to make network mounts reliable. Seems hit or miss otherwise.
Tom,
Do you mind sharing that script? It's a great idea for solving a common problem.
Thanks,
Matthew Roth InterMedia Marketing Solutions Software Engineer and Systems Developer
On Thu, 17 May 2012 10:52:15 -0500 (CDT) Matthew J. Roth wrote:
Do you mind sharing that script? It's a great idea for solving a common problem.
This will probably get mangled due to a few long lines, but I'll give it a shot.
In the /etc/rc.d/rc.local script I have this line:
/usr/local/bin/bg-mount-nfs
That /usr/local/bin/bg-mount-nfs script looks like:
#!/bin/bash # # Background mounts for each of the nfs filesystems appearing in # /etc/fstab not marked as noauto # PATH="/sbin:/usr/sbin:/bin:/usr/bin" export PATH sed -e '/^#/d' -e 's/[ \t][ \t]*/\t/g' /etc/fstab | grep -w nfs | grep -w -v noauto | cut -f2 | while read mountpoint do nohup /usr/local/bin/mount-filesystem "$mountpoint" > /dev/null 2>&1 < /dev/null & done
And the /usr/local/bin/mount-filesystem script it backgrounds for each filesystem looks like:
#!/bin/bash # # Argument is a mountpoint, keep trying to mount the thing till # it appears in /proc/mounts. # PATH="/sbin:/usr/sbin:/bin:/usr/bin" export PATH if [ -z "$1" ] then echo Hey! Missing mountpoint argument! 1>&2 exit 2 fi check=`sed -e '/^#/d' -e 's/[ \t][ \t]*/\t/g' /etc/fstab | cut -f2 | fgrep -x "$1"` if [ "$check" = "$1" ] then : else echo "$1" does not appear as a mountpoint in /etc/fstab! 1>&2 exit 2 fi while true do check=`sed 's/[ \t][ \t]*/\t/g' /proc/mounts | cut -f2 | fgrep -x "$1"` if [ "$check" = "$1" ] then exit 0 fi if mount "$1" -o fg then : else sleep 10 fi done
Tom Horsley wrote:
This will probably get mangled due to a few long lines, but I'll give it a shot.
Tom,
It looks good from here. Thanks for saving me from reinventing that wheel. Just the sed incantations would've taken a while to come up with.
Regards,
Matthew Roth InterMedia Marketing Solutions Software Engineer and Systems Developer
On 05/17/2012 06:08 PM, Jonathan Allen wrote:
Hi All,
On a fully up-to-date F16 system (as of this morning) I have an issue with remote mounting directories at boot. The machine's /etc/fstab contains these two lines:
purse:/share /share nfs rw,rsize=8192,wsize=8192,timeo=14,intr,addr=192.168.1.10 0 0 mirror:/home /home nfs nfsvers=3,rw,rsize=8192,wsize=8192,timeo=14,intr,addr=192.168.1.1 0 0
The first, to an F6 machine, always works. The second, to an F14 machine never works at boot time, but always works with 'mount -a' done later in a root (text) login session or 'su' time.
How can I get this to work without manual intervention?
Jonathan
You can try enabling NetworkManager-wait-online.service.
Jonathan Allen wrote:
Hi All,
On a fully up-to-date F16 system (as of this morning) I have an issue with remote mounting directories at boot. The machine's /etc/fstab contains these two lines:
purse:/share /share nfs rw,rsize=8192,wsize=8192,timeo=14,intr,addr=192.168.1.10 0 0 mirror:/home /home nfs nfsvers=3,rw,rsize=8192,wsize=8192,timeo=14,intr,addr=192.168.1.1 0 0
The first, to an F6 machine, always works. The second, to an F14 machine never works at boot time, but always works with 'mount -a' done later in a root (text) login session or 'su' time.
How can I get this to work without manual intervention?
I would not be surprised if F14 is nfs4, and I've seen similar issues, older servers using nfs3 work better. it could be related to nfs-idmapd getting going, can't say for sure.
I don't think Networkmanager-wait-online will help, as the mounts to old releases need a network, too, and they work.
And you didn't ask, but I'll mention that putting IP addresses in fstab is an opportunity for simple changes to break things. I have seen people learn this the hard way, although I didn't.
On 05/17/2012 09:54 AM, Bill Davidsen wrote:
Jonathan Allen wrote:
Hi All,
On a fully up-to-date F16 system (as of this morning) I have an issue with remote mounting directories at boot. The machine's /etc/fstab contains these two lines:
purse:/share /share nfs rw,rsize=8192,wsize=8192,timeo=14,intr,addr=192.168.1.10 0 0 mirror:/home /home nfs nfsvers=3,rw,rsize=8192,wsize=8192,timeo=14,intr,addr=192.168.1.1 0 0
The first, to an F6 machine, always works. The second, to an F14 machine never works at boot time, but always works with 'mount -a' done later in a root (text) login session or 'su' time.
How can I get this to work without manual intervention?
I would not be surprised if F14 is nfs4, and I've seen similar issues, older servers using nfs3 work better. it could be related to nfs-idmapd getting going, can't say for sure.
I don't think Networkmanager-wait-online will help, as the mounts to old releases need a network, too, and they work.
And you didn't ask, but I'll mention that putting IP addresses in fstab is an opportunity for simple changes to break things. I have seen people learn this the hard way, although I didn't.
Are you sure that the local /home disk partition is mounted BEFORE the NFS mount occurs? It could be that the NFS mount occurs at /home first, then the local /home mount occurs, overlays the NFS mount and hides it. Ditto with the /share mountpoint.
Before you do the "mount -a", do a simple "mount" and verify that you haven't got the local partitions overlaying the NFS mounts. ---------------------------------------------------------------------- - Rick Stevens, Systems Engineer, AllDigital ricks@alldigital.com - - AIM/Skype: therps2 ICQ: 22643734 Yahoo: origrps2 - - - - Overweight: When you step on your dog's tail...and it dies. - ----------------------------------------------------------------------
Rick,
Are you sure that the local /home disk partition is mounted BEFORE the NFS mount occurs? It could be that the NFS mount occurs at /home first, then the local /home mount occurs, overlays the NFS mount and hides it. Ditto with the /share mountpoint.
Before you do the "mount -a", do a simple "mount" and verify that you haven't got the local partitions overlaying the NFS mounts.
No, that all looks exactly clean and as I would have expected it without the NFS mount. This is running on physical partitions, BTW, rather than LVM, in case that has anything to do with it.
Jonathan