NFS share won't automount :(

Hi, I’m using NFS to share files between 2 linux boxes, the server is on suse 10.2 and the client on suse 11.1 with kde 4.3. Everything was working ok till recently. Actually I don’t know what I did, that stopped automounting NFS shares from other pc, it may be since I upgraded kde from 4.1 to 4.3, but 'm not sure. Entries in /etc/fstab which were not modified, looke like this:

192.168.1.10:/mnt/sdb1/Data        /media/Data   nfs     defaults 0 0
192.168.1.10:/home/backup /media/backup     nfs     defaults 0 0

. If I go to konsole and do

mount -a

it mounts everything ok, and it seeems that only on boot time the NFS shares do not mount. All other local drives mount ok. Thanks in advance.

Did you llook for error messages with *dmesg *after a boot?

Did you llook for error messages with dmesg after a boot?
Nope I didn’t before posting. So I tried

dmesg |grep 192.168.1.10

and got a few lines matching my query, but didn’t save the output >:(, because I thought I should reboot first before issuing dmesg, but after reboot the same query didn’t output anything, I checked the nfs folders and they were mounted,…grrrr. This is a bit weird. I’ll pay more attention from now on, to see in which cases they do mount, or what possibly unmounts them.

Never mind. Only the fact that someone paid attention to your problem did cure it (I hope). rotfl!

This time nfs didn’t mount, because the other pc was powered off. I did dmesg and got

dmesg |grep 192.168.1.10
SFW2-INext-DROP-DEFLT IN=eth0 OUT= MAC=01:00:5e:00:00:fb:00:0f:ea:66:68:0b:08:00 SRC=192.168.1.10 DST=224.0.0.251 LEN=74 TOS=0x00 PREC=0x00 TTL=255 ID=0 DF PROTO=UDP SPT=5353 DPT=5353 LEN=54
SFW2-INext-DROP-DEFLT IN=eth0 OUT= MAC=01:00:5e:00:00:fb:00:0f:ea:66:68:0b:08:00 SRC=192.168.1.10 DST=224.0.0.251 LEN=74 TOS=0x00 PREC=0x00 TTL=255 ID=0 DF PROTO=UDP SPT=5353 DPT=5353 LEN=54
SFW2-INext-DROP-DEFLT IN=eth0 OUT= MAC=01:00:5e:00:00:fb:00:0f:ea:66:68:0b:08:00 SRC=192.168.1.10 DST=224.0.0.251 LEN=74 TOS=0x00 PREC=0x00 TTL=255 ID=0 DF PROTO=UDP SPT=5353 DPT=5353 LEN=54
SFW2-INext-DROP-DEFLT IN=eth0 OUT= MAC=01:00:5e:00:00:fb:00:0f:ea:66:68:0b:08:00 SRC=192.168.1.10 DST=224.0.0.251 LEN=107 TOS=0x00 PREC=0x00 TTL=255 ID=0 DF PROTO=UDP SPT=5353 DPT=5353 LEN=87
SFW2-INext-DROP-DEFLT IN=eth0 OUT= MAC=01:00:5e:00:00:fb:00:0f:ea:66:68:0b:08:00 SRC=192.168.1.10 DST=224.0.0.251 LEN=107 TOS=0x00 PREC=0x00 TTL=255 ID=0 DF PROTO=UDP SPT=5353 DPT=5353 LEN=87
SFW2-INext-DROP-DEFLT IN=eth0 OUT= MAC=01:00:5e:00:00:fb:00:0f:ea:66:68:0b:08:00 SRC=192.168.1.10 DST=224.0.0.251 LEN=107 TOS=0x00 PREC=0x00 TTL=255 ID=0 DF PROTO=UDP SPT=5353 DPT=5353 LEN=87
SFW2-INext-DROP-DEFLT IN=eth0 OUT= MAC=01:00:5e:00:00:fb:00:0f:ea:66:68:0b:08:00 SRC=192.168.1.10 DST=224.0.0.251 LEN=107 TOS=0x00 PREC=0x00 TTL=255 ID=0 DF PROTO=UDP SPT=5353 DPT=5353 LEN=87

Ok, if server is not on, I know nfs can’t be mounted, but am not sure if this is always the case. I’ll be watching this for some time, and report further results :wink:

When it is not allways certain that the server is running, you could make a crontab entry for mounting say every 5 minutes. In that case the mount will take place asap after the server is booted. The clients users could even be teached that when he/she misses data that resides on the server, she/he should turn on the server, take a coffee and start working after say 10 minutes.

I have made a file in the directory that serves as mount point on a moment that was no mount on it:

touch /home/wij/Not-mounted

And roots crontab entry:

*/5 * * * *     -a /home/wij/Not-mounted ]] && mount /home/wij >/dev/null 2>&1

Hope you get the basics and can adapt this to your environment.

Thanks, I’ll give it a try :slight_smile:

Uf, I’m not that experienced in scripting, so it took me a while :). What I did is, one script to check if nfs folders are mounted and returns 0 if they are, script looks like this.

#!/bin/bash
#echo "$0: This is it"
m1=$( mount |grep 192.168.1.10:/home/backup -c )
m2=$( mount |grep 192.168.1.10:/mnt/sdb1/Data -c )
if test $m1 -eq 1 && test $m2 -eq 1
then
echo 1
else
echo 0
fi

, the second script I did is to mount the nfs folders

#!/bin/bash
mount 192.168.1.10:/home/backup /media/backup
mount 192.168.1.10:/mnt/sdb1/Data /media/Data

Then I added new line in /etc/crontab like this

*/5 * * * *    root /home/arcull/nfs_not_mounted && /home/arcull/nfs_mount

Which should mean: if the first script returns 0, meaning that nfs folders aren’t mounted, then run the second script to mount them. Then I did unmount both nfs folders to see if cron will mount them and it works great.<:)

That is nice and it has the advantage that you have written it yourself, but it is not different from what I gave you.