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:
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.
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
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.
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
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.<:)