Help and advise required with NFS not auto mountng at boot

I have a oS11.2 with KDE4.3.5 desktop pc using ext4 filesystem which I use as a basic file server on a small network to server a winXP laptop and my oS11.2 laptop. I’ve configured NFS server and samba server on the server.

I also have a laptop with oS11.2 KDE4.4.0 and ext4 filesystem which I’ve configured to access the server’s hard drives using NFS. It works fine apart from the remote drives don’t mount automatically when I boot and log into the laptop. It did work in oS 11.1 though. Below is my fstab from the laptop.

/dev/disk/by-id/ata-Hitachi_HTS542525K9SA00_071007BB0F00WDGAHZXA-part3     /boot    ext4    acl,user_xattr 1 2 
/dev/disk/by-id/ata-Hitachi_HTS542525K9SA00_071007BB0F00WDGAHZXA-part6     swap    swap    defaults 0 0 
/dev/disk/by-id/ata-Hitachi_HTS542525K9SA00_071007BB0F00WDGAHZXA-part5     /    ext4    acl,user_xattr 1 1 
/dev/disk/by-id/ata-Hitachi_HTS542525K9SA00_071007BB0F00WDGAHZXA-part8     /VAULT    ext4    defaults 1 2 
/dev/disk/by-id/ata-Hitachi_HTS542525K9SA00_071007BB0F00WDGAHZXA-part7     /home    ext4    defaults 1 2 
/dev/disk/by-id/ata-Hitachi_HTS542525K9SA00_071007BB0F00WDGAHZXA-part1     /windows/C    ntfs-3g     uid=User,gid=users,umask=0022,locale=en_GB.UTF-8 0 0 
proc    /proc    proc    defaults 0 0 
sysfs    /sys    sysfs    noauto 0 0 
debugfs    /sys/kernel/debug    debugfs    noauto 0 0 
usbfs    /proc/bus/usb    usbfs    noauto 0 0 
devpts    /dev/pts    devpts    mode=0620,gid=5 0 0 
192.168.1.11:/DATA_I    /mnt/Data_I              nfs     rw,noexec,nosuid,_netdev,nodev,acl 0 0 
192.168.1.11:/DATA_II    /mnt/Data_II              nfs     rw,noexec,nosuid,_netdev,nodev,acl 0 0 
192.168.1.11:/media/LacieMedia    /mnt/LacieMedia      nfs     rw,noexec,nosuid,nodev,_netdev 0 0 
192.168.1.11:/media/LacieBackup    /mnt/LacieBackup  nfs     rw,noexec,nosuid,nodev,_netdev 0 0 

I have also configured cron to sleep for 60s before running the mount -a command just in case the network isn’t up and ready at the time fstab tries to mount the remote drives - as suggestted on Swerdna’s guide.

@reboot sleep 60;mount -a

I’d appreciate any help on this.

Also, if the laptop is already booted before any connection to the server was established, how can I get it to automatically detect and mount the remove drives once a connection is restored. E.G. I use the laptop off site then return with it in sleep mode. Open the laptop and it restores the network connection on my network but it doesn’t automatically attempt to mount the remote drives.
What’s the best way to get the drives to auto mount in this case? I was expecting the NFS deamon to be continually listening and mount the drives when they show up on the network but it doesn’t seem to work like that.

 `rpcinfo -p 192.168.1.11 | awk '/nfs|mountd/ { print $5}' | sort -u | wc -l` -ge 2 ] && mount -a -t nfs

in a cron job, rc script or somewhere…
Although in a cron job, I would check before if it isn’t already mounted.

There are some network hook scripts in /etc/sysconfig/network/if-up.d which are actually links to /etc/sysconfig/network/scripts. Have a look at an existing script to see how to write one.

Thanks. I don’t really understand what’s going on before the mount command but I’ll try figure it out.

So does this mean that the functionality of auto mounting the nfs drives once the network becomes available is not already a feature of the default install? If I need to write a script that’s fine, I just don’t want to be reinventing the wheel if the functionality already exists or is available in another way.

You asked about a network being available event. This is different from mount at boot. The latter should work.

In my first post I was asking about both mounting the nfs at boot and on an network event - i.e. when the network becomes available.

Mounting at boot used to work in 11.1 using the method I described but doesn’t work in 11.2 for some reason. Not sure why it wouldn’t. I believe the command please_try_again posted is for this scenario - of auto mounting the nfs after boot.

I never managed to get the nfs drives to mount on network event which was my second question. I guess this is what I need to write the scripts for.

Are my interpretations correct?

That’s right.

I did not read and digest all above, but did you contemplate about the difference between:

  1. a system booting into runlevel 3 (or 5) with traditional ifup that starts the network and then does a *mount -a *in the startup scripts (init.d);
  2. a system (often done with laptops) where the network is NOT started at reaching runlevel 5, the mount -a is done nevertheless (because you want your local partitions) and the network is only started after a user loged in and used Networkmanager (and thus to late for the *mount -a *in the startup sequence)?

And no, NFS client is not a polling system that tries again and again if one of its NFS servers did come to life. But maybe configuring the automounter (which is something different from what you call ‘automount’) may be usefull here. It tries to mount when access to a file inside a mountpoint is done. See:

man automount