-   Slackware (
-   -   strange thing with nfs (

egag 04-29-2005 08:19 PM

strange thing with nfs
hoi all...

when i mount on pc A a nfs-share wich is on the disk of pc B,
and i shutdown pc B then i get the following :

-konquerer will not show the root-dir.
after a while i don't even get the filename of subdirs.

-ksysguard gives only "888888....etc" in the status bar, and no data on
running processes.
-i cannot unmount the share

i get kernel messages saying it's trying to mount and
in a console all is normal ( "ls / " and " top" work ok )

in the exports file on pc B there's only the (rw,sync) option.

rebooting pc B makes all normal again and then
i can unmount the share .

i think i have to change some setings somewhere , but
i can't find it.

any suggestions welcome .


AltF4 04-29-2005 08:22 PM

mount the NFS directory with the "-o soft" option

egag 04-29-2005 08:27 PM

hmmm.....from " man mount "
soft This option allows the kernel to time out if the nfs server is not
responding for some time. The time can be specified with timeo=time.
This option might be useful if your nfs server sometimes doesn't
respond or will be rebooted while some process tries to get a file
from the server. Usually it just causes lots of trouble.


it sais it should work, but also causes " lot's of trouble ".

maybe there's more options...


egag 04-30-2005 08:09 AM

well.....using the " soft " option makes it a little better.
switching to the root dir causes a timeout of a few minutes,
but it won't hang.

on pc A the mount command gives

------- on /diskhome type nfs (rw,soft,intr,addr=

but it's only kde app.'s that are bothered; cli works ok.
so maybe i should set smth. in kde.....?


keefaz 04-30-2005 12:53 PM

Try automount your nfs share, it is not too hard to set (your kernel has to be
configured with autofs though, preferably as module)

- installpkg autofs
- create a /etc/auto.master file with the content :

/net    /etc/
- create a /etc/ file with the content :

packages    -fstype=nfs,rw,hard,intr
For some reason, there is no rc.autofs installed with the autofs package
so there is one :

save it as /etc/rc.d/rc.autofs
Then chmod +x it and /etc/rc.d/rc.autofs start, maybe add
' /etc/rc.d/rc.autofs start ' in rc.local

So try : konqueror /net/packages

egag 04-30-2005 05:19 PM

well....been trying for hours to get it working.
are you sure the script is ok ?
it won't run ok.......

maybe someone can explain this part:
function getmounts()
# Check for local maps to be loaded
if [ -f /etc/auto.master ]
echo "echo "check"" #<---- added by me
cat /etc/auto.master | sed -e '/^#/d' -e '/^$/d'| (
while read dir map options
if [ ! -z "$dir" -a ! -z "$map" \
-a x`echo "$map" | cut -c1` != 'x-' ]
echo "echo "check1 "" #<added by me

this function is called as " getmounts | sh "

i added two checks.
the first one is echoed, the 2.nd one not.

and it's after this that the command " automount" is issued
so that's never run.


keefaz 05-01-2005 01:35 AM

I have used this script for a long time, it works fine

I added your line to test at the same place in rc.autofs
"check1" was echoed 3 times when I did rc.autofs restart

Could you post auto.master and auto.* associed file ?

keefaz 05-01-2005 02:05 AM


maybe someone can explain this part

if [ ! -z "$dir" -a ! -z "$map" \
-a x`echo "$map" | cut -c1` != 'x-' ]

There are 3 expressions :
! -z "$dir" : $dir must not be empty
! -z "$map" : $map must not be empty

x`echo "$map" | cut -c1` != 'x-' : this one seems complicated but not really,
first let see what is between the ` ` chars : echo "$map" | cut -c1
so it takes the first char in $map variable if $map was equal to "-fs", then
x`echo "$map" | cut -c1` != 'x-'
x- != 'x-' : so the test return false
(basically, if the first char of $map contains '-', the last test returns false)

And finally the -a connective option stands for the 3 expressions must returns true
like : expression1 && expression2 && expression3

egag 05-01-2005 07:44 AM

thanks for the clear explanation.

i have these files :



/net    /etc/  --timeout=60


packages        -fstype=nfs,rw,hard,intr
a              -fstype=auto,rw,sync,umask=002  :/dev/fd0
d              -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom

(i added cd & floppy also )

when running the script with these files, we should get

$dir = /net


$map =/etc/

and that should work then....but it doesn't.

any idea ?


egag 05-01-2005 10:44 AM

well.....i got it.

in the file /etc/auto.master i needed to put a return at the end of the line
( just hit enter )

thanks for the help/explanation.

it works nice :)


keefaz 05-01-2005 10:46 AM

I would remove --timeout in auto.master to see if it works but frankly
I have no idea why /etc/auto.master does not pass the first test in
getmounts() function :


echo "/net    /etc/  --timeout=60" |  (
        while read dir map options; do
            if [ ! -z "$dir" -a ! -z "$map" -a x`echo "$map" | cut -c1` != 'x-' ]; then
                echo "test ok"
                echo "dir: $dir"
                echo "map: $map"
                echo "options: $options"
test ok
dir: /net
map: /etc/
options: --timeout=60

That works as expected...

I am glad you get it working ;)

egag 05-01-2005 10:51 AM

i think it's rather a stupid mistake.
took me 6 hours and i got the script almost memorised :D


soyloquesoy 07-13-2005 12:54 PM

Do the /net and /net/packages
directories have to be created? Or are they created by the automount scripts?

I have tried to do this following your instructions (ie. without creating the directories) and I get the following error:
[root@machine1 /]# cd /net/packages
bash: cd: /net/packages: No such file or directory



egag 07-13-2005 01:03 PM

only /net; just use " #mkdir /net " to make it.



All times are GMT -5. The time now is 03:48 AM.