Author Topic: <solved (with work around)> NFS Shares not mounting automatically under 2010  (Read 1434 times)

Offline Jaycoke

  • Full Member
  • ***
  • Posts: 144
    • PCLinuxOS Group on identi.ca Join today!
Hi all,

I have been trying to figure this out since 2010 beta 1. On my laptop with 2010 final LXDE installed ( a Compaq Presario 2100 (see output of lshw attached )) I have NFS set-up, and can manually mount the NFS shares once the computer is booted up with 'mount -a' as root. So I have everything configured right, but it just seems like my wireless connection is not starting in time before the netfs mount command is issued during the start-up scripts.


Code: [Select]
*-network:0
             description: Wireless interface
             product: BCM4306 802.11b/g Wireless LAN Controller
             vendor: Broadcom Corporation
             physical id: 9
             bus info: pci@0000:00:09.0
             logical name: wlan0
             version: 02
             serial: xx:xx:xx:xx:xx:xx
             width: 32 bits
             clock: 33MHz
             capabilities: pm bus_master cap_list ethernet physical wireless
             configuration: broadcast=yes driver=ndiswrapper+airforceone driverversion=1.55+Broadcom,09/20/2007, 4.170. ip=192.168.xxx.xxx latency=64 link=yes module=ndiswrapper multicast=yes wireless=IEEE 802.11g

Here is what I have set to start at boot;

Code: [Select]
[root@laptop jaycoke]# cd /etc/rc5.d
[root@laptop rc5.d]# ls
K00netconsole@  S12syslog@      S26apmd@        S51xfs@         S56xinetd@        S84avahi-daemon@  S95kheader@
K10pptp@        S13irqbalance@  S40atd@         S52nfs-common@  S60nfs-server@    S84haldaemon@     S99laptop-mode@
S03iptables@    S14acpid@       S50cpufreq@     S53netfs@       S60uuidd@         S84udev-post@     S99local@
S09resolvconf@  S17alsa@        S50network-up@  S54shorewall@   S82network-auth@  S85dm@
S10network@     S18sound@       S51rpcbind@     S56ntpd@        S83messagebus@    S90crond@

I have also attached my dmesg file.

Can any one else verify this or better yet offer a solution? ;D It has been driving me crazy :o
« Last Edit: April 17, 2010, 03:37:02 PM by Jaycoke »

Offline muungwana

  • Hero Member
  • *****
  • Posts: 6214
Re: NFS Shares not mounting automatically under 2010
« Reply #1 on: April 17, 2010, 03:12:50 PM »

This is more of a work around than a solution but it might work. Add "mount -a" command to the end of "/etc/rc.local" script. Hopefully this scripts runs after your wireless network is up. It is possible to delay execution of that line if it comes to it.

This script is the last script that runs before the GUI startup.

.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6852
  • MLU
Re: NFS Shares not mounting automatically under 2010
« Reply #2 on: April 17, 2010, 03:20:12 PM »
Both in Beta and in final, I shared between two PCs using NFS, (one PC doing the serving) and to get the shares to mount on the client PC I had to set up a share on that one also (temporarily) .....  seems it was the only way to get the share mounting properly.

It worked so I did not bother looking after that.

Offline aherkey

  • Full Member
  • ***
  • Posts: 109
Re: NFS Shares not mounting automatically under 2010
« Reply #3 on: April 17, 2010, 03:38:20 PM »
You need to add retry options to the /etc/fstab file for the nfs share. I have to caution you though, since this is a laptop and the share won't always be available this can hang the network and disk access until it times out.

See the nfs man page for the MOUNT OPTIONS that can be used in the /etc/fstab file.
Code: [Select]
       bg / fg        Determines  how  the  mount(8)  command  behaves if an attempt to mount an export fails.  The fg option
                      causes mount(8) to exit with an error status if any part of the mount request times out or  fails  out‐
                      right.  This is called a "foreground" mount, and is the default behavior if neither the fg nor bg mount
                      option is specified.

                      If the bg option is specified, a timeout or failure causes the mount(8) command to fork a  child  which
                      continues  to attempt to mount the export.  The parent immediately returns with a zero exit code.  This
                      is known as a "background" mount.

                      If the local mount point directory is missing, the mount(8) command acts as if the mount request  timed
                      out.  This permits nested NFS mounts specified in /etc/fstab to proceed in any order during system ini‐
                      tialization, even if some NFS servers are  not  yet  available.   Alternatively  these  issues  can  be
                      addressed using an automounter (refer to automount(8) for details).

       retry=n        The  number  of  minutes  that the mount(8) command retries an NFS mount operation in the foreground or
                      background before giving up.  If this option is not specified, the default value for foreground  mounts
                      is  2  minutes,  and  the  default  value for background mounts is 10000 minutes (80 minutes shy of one
                      week).  If a value of zero is specified, the mount(8) command exits immediately after the  first  fail‐
                      ure.

Example of the fstab entry:
Code: [Select]
zeus:/data /data nfs rsize=8192,wsize=8192,nosuid,soft,bg,retry=2 0 0


- Andy

Offline Jaycoke

  • Full Member
  • ***
  • Posts: 144
    • PCLinuxOS Group on identi.ca Join today!
Thanks for the quick reply!

@muungwana I added

sleep 90s mount -a to /etc/rc.local

It seemed like it just needed a little more time to get the wireless running.

@JohnBoy, I haven't tried your suggestion yet, but I may try it later.

@aherkey This looks like a likely solution as well,

Good to know there is more than one way to skin a penguin!!

Offline Jaycoke

  • Full Member
  • ***
  • Posts: 144
    • PCLinuxOS Group on identi.ca Join today!
Modified the command in
/etc/rc.local

Code: [Select]
sleep 90s mount -a to Opps forgot the ';' (semi-colon)
Code: [Select]
sleep 30s; mount -a
 :-[ :-[