• Mount point - timeout

    From Steve@110:300/1.1 to All on Tue Nov 3 11:34:00 2009
    Hi,

    I am using a script where I use a lot of mount points
    ( mount xx.zz.cc.vv:/sss/ /mnt/qqq )

    Unfortunately, if the resource is not available, the system is waiting
    for minimum 10 min ( maybe for ever :-) to get access to the 'drive'

    Is there a way to tell the 'mount' NOT to spend more than 2 min on each connection ? ( and to execute the next instruction )

    Thanks

    Steve

    --- MBSE BBS v0.95.5 (GNU/Linux-x86_64)
    * Origin: Guest of ProXad - France (110:300/1.1@linuxnet)
  • From Johannes von Rotz@110:300/1.1 to All on Tue Nov 3 13:07:43 2009
    Steve wrote:
    Hi,

    I am using a script where I use a lot of mount points
    ( mount xx.zz.cc.vv:/sss/ /mnt/qqq )

    Unfortunately, if the resource is not available, the system is waiting
    for minimum 10 min ( maybe for ever :-) to get access to the 'drive'

    Is there a way to tell the 'mount' NOT to spend more than 2 min on each connection ? ( and to execute the next instruction )

    Thanks

    Steve

    Hey.

    Maybe you can tweak it with the 'timeo' and 'retrans' options fo NFS.
    `man nfs` for further explanations.

    To stop retrying file operations indefinitely, use the 'soft' option.

    I don't really know if these options have any affect on mounting, but i
    guess mounting is a file operation like any other.

    Another idea would be to use automount, which would open a connection
    only, when needed. Also, you wouldn't need to maintain a huge script...

    --- MBSE BBS v0.95.5 (GNU/Linux-x86_64)
    * Origin: hispeed.ch (110:300/1.1@linuxnet)
  • From Moe Trin@1:0/0 to All on Tue Nov 3 20:46:20 2009
    On 03 Nov 2009, in the Usenet newsgroup alt.os.linux.redhat, in article <4af00718$0$2754$426a34cc@news.free.fr>, Steve wrote:

    I am using a script where I use a lot of mount points
    ( mount xx.zz.cc.vv:/sss/ /mnt/qqq )

    That looks like NFS - but you are not providing any details, so it's
    a guess of what else is wrong.

    Unfortunately, if the resource is not available, the system is waiting
    for minimum 10 min ( maybe for ever :-) to get access to the 'drive'

    man 5 nfs

    under 'retry' - a foreground mount waits 2 minutes by default while
    a background mount waits 10000 minutes (80 minutes less than 2 weeks).

    Is there a way to tell the 'mount' NOT to spend more than 2 min on
    each connection ? ( and to execute the next instruction )

    If that is NFS, yes. Otherwise, more details needed.

    Old guy

    --- MBSE BBS v0.95.5 (GNU/Linux-x86_64)
    * Origin: The KofoBBS MBSE - telnet://fido1.kofobbs.net
  • From Steve@110:300/1.1 to All on Tue Nov 3 21:27:40 2009
    On Tue, 03 Nov 2009 13:46:20 -0600, Moe Trin wrote:

    On 03 Nov 2009, in the Usenet newsgroup alt.os.linux.redhat, in article <4af00718$0$2754$426a34cc@news.free.fr>, Steve wrote:

    I am using a script where I use a lot of mount points ( mount >>xx.zz.cc.vv:/sss/ /mnt/qqq )

    That looks like NFS - but you are not providing any details, so it's a
    guess of what else is wrong.

    Unfortunately, if the resource is not available, the system is waiting
    for minimum 10 min ( maybe for ever :-) to get access to the 'drive'

    man 5 nfs

    under 'retry' - a foreground mount waits 2 minutes by default while a background mount waits 10000 minutes (80 minutes less than 2 weeks).

    Is there a way to tell the 'mount' NOT to spend more than 2 min on each >>connection ? ( and to execute the next instruction )

    If that is NFS, yes. Otherwise, more details needed.

    Old guy


    Hi Guys,

    Yes, that was for an NFS mount. Sorry, I was not really clear.
    Thanks anyway


    I don't know if my mount is in background or not ( as I could see on the web....
    All I want to do, is to have a script and mount some 'drives'
    ( If I write the command line by hand.. is that in Background ?? )

    Anyway, I try something like : mount 192.168.0.2:/home/xxx /mnt/servera -
    o timeo=2,retry=0

    That sounds not really OK. after 10 min... still waiting....it doesn't
    give up :-(

    Cheers,

    Steve




    Thanks

    Steve


    --- MBSE BBS v0.95.5 (GNU/Linux-x86_64)
    * Origin: Guest of ProXad - France (110:300/1.1@linuxnet)
  • From Moe Trin@1:0/0 to All on Wed Nov 4 04:09:25 2009
    On 03 Nov 2009, in the Usenet newsgroup alt.os.linux.redhat, in article <4af0923c$0$25361$426a74cc@news.free.fr>, Steve wrote:

    I don't know if my mount is in background or not (as I could see on
    the web....

    Is the process that runs the command in the foreground (an icon you
    clicked that opens a terminal, or something you are doing _directly_
    from the command line)? Or is this a daemon, or a sub-shell run by
    a daemon such as crond?

    All I want to do, is to have a script and mount some 'drives'
    ( If I write the command line by hand.. is that in Background ?? )

    From a terminal, such as what I'm typing in now - no. To put it
    in the background, you would have to append a ' &' to the command, OR
    run the command from a process that itself was started that way.

    Anyway, I try something like : mount 192.168.0.2:/home/xxx /mnt/servera
    -o timeo=2,retry=0

    That sounds not really OK. after 10 min... still waiting....it doesn't
    give up :-(

    How about

    mount -t nfs -o timeo=2,retry=1,soft 192.168.0.2:/home/xxx /mnt/servera

    You can also put these mount options/variables in /etc/fstab IF YOU
    INCLUDE a 'noauto' option as well, and then your original mount
    command will be interpreted by looking at /etc/fstab and including the
    stuff that's in there (the 'noauto' prevents the system boot scripts
    from trying to mount the NFS file at boot). Perhaps

    192.168.0.2:/home/xxx /mnt/servera nfs noauto,timeo=2,retry=1,soft 0 0

    (that's all one line in /etc/fstab).

    What is causing the non-availability? Is the file server down, or not accessible by existing networking? You may want to put a test to see if
    the server is reachable before you try to mount from it.

    Old guy

    --- MBSE BBS v0.95.5 (GNU/Linux-x86_64)
    * Origin: The KofoBBS MBSE - telnet://fido1.kofobbs.net
  • From Steve@110:300/1.1 to All on Wed Nov 4 08:51:41 2009
    On Tue, 03 Nov 2009 21:09:25 -0600, Moe Trin wrote:

    On 03 Nov 2009, in the Usenet newsgroup alt.os.linux.redhat, in article <4af0923c$0$25361$426a74cc@news.free.fr>, Steve wrote:

    I don't know if my mount is in background or not (as I could see on the >>web....

    Is the process that runs the command in the foreground (an icon you
    clicked that opens a terminal, or something you are doing _directly_
    from the command line)? Or is this a daemon, or a sub-shell run by a
    daemon such as crond?

    All I want to do, is to have a script and mount some 'drives' ( If I
    write the command line by hand.. is that in Background ?? )

    From a terminal, such as what I'm typing in now - no. To put it in the background, you would have to append a ' &' to the command, OR run the command from a process that itself was started that way.

    Anyway, I try something like : mount 192.168.0.2:/home/xxx /mnt/servera
    -o timeo=2,retry=0

    That sounds not really OK. after 10 min... still waiting....it doesn't
    give up :-(

    How about

    mount -t nfs -o timeo=2,retry=1,soft 192.168.0.2:/home/xxx
    /mnt/servera

    You can also put these mount options/variables in /etc/fstab IF YOU
    INCLUDE a 'noauto' option as well, and then your original mount command
    will be interpreted by looking at /etc/fstab and including the stuff
    that's in there (the 'noauto' prevents the system boot scripts from
    trying to mount the NFS file at boot). Perhaps

    192.168.0.2:/home/xxx /mnt/servera nfs noauto,timeo=2,retry=1,soft
    0 0

    (that's all one line in /etc/fstab).

    What is causing the non-availability? Is the file server down, or not accessible by existing networking? You may want to put a test to see if
    the server is reachable before you try to mount from it.

    Old guy

    Hi Moe,

    I wrote a small script file, which try to access some servers. I know
    that some of them, are not switched on all day long.
    So, the idea is to start the script and connect to all servers
    available...

    I don't need necessary to start this script every day.

    your syntax gives me a better result. at least, it stop after a while...
    I tried with 'retry=0' to speed up the process... but at least that works
    out

    thank you !!

    Steve





    --- MBSE BBS v0.95.5 (GNU/Linux-x86_64)
    * Origin: Guest of ProXad - France (110:300/1.1@linuxnet)
  • From Moe Trin@1:0/0 to All on Wed Nov 4 20:30:38 2009
    On 04 Nov 2009, in the Usenet newsgroup alt.os.linux.redhat, in article <4af1328d$0$31173$426a74cc@news.free.fr>, Steve wrote:

    Moe Trin wrote:

    What is causing the non-availability? Is the file server down, or
    not accessible by existing networking? You may want to put a test
    to see if the server is reachable before you try to mount from it.

    I wrote a small script file, which try to access some servers. I
    know that some of them, are not switched on all day long.
    So, the idea is to start the script and connect to all servers
    available...

    Normally, I'd consider testing to see if the server is up before
    attempting to connect. Assuming the servers are configured to
    respond to a ping (definitely not always the case), perhaps

    ping -qc2 server_a
    if [ $? = "0" ] ; then
    connect_to_server_a
    else
    server_a_not_there
    fi
    ping -qc2 server_b

    and so on. If the server is configured to not respond to pings
    (ICMP Echo), then use something like hping2 or hping3
    (http://www.hping.org/ - but it doesn't seem to have been updated
    since 2005) to see if a UDP port is reachable.

    Old guy

    --- MBSE BBS v0.95.5 (GNU/Linux-x86_64)
    * Origin: The KofoBBS MBSE - telnet://fido1.kofobbs.net
  • From Steve@110:300/1.1 to All on Fri Nov 6 18:59:05 2009
    On Wed, 04 Nov 2009 13:30:38 -0600, Moe Trin wrote:

    On 04 Nov 2009, in the Usenet newsgroup alt.os.linux.redhat, in article <4af1328d$0$31173$426a74cc@news.free.fr>, Steve wrote:

    Moe Trin wrote:

    What is causing the non-availability? Is the file server down, or not
    accessible by existing networking? You may want to put a test to see
    if the server is reachable before you try to mount from it.

    I wrote a small script file, which try to access some servers. I know
    that some of them, are not switched on all day long. So, the idea is to >>start the script and connect to all servers available...

    Normally, I'd consider testing to see if the server is up before
    attempting to connect. Assuming the servers are configured to respond to
    a ping (definitely not always the case), perhaps

    ping -qc2 server_a
    if [ $? = "0" ] ; then
    connect_to_server_a
    else
    server_a_not_there
    fi
    ping -qc2 server_b

    and so on. If the server is configured to not respond to pings (ICMP
    Echo), then use something like hping2 or hping3 (http://www.hping.org/ -
    but it doesn't seem to have been updated since 2005) to see if a UDP
    port is reachable.

    Old guy

    Thank you. I will try it

    thanks again for your help

    --- MBSE BBS v0.95.5 (GNU/Linux-x86_64)
    * Origin: Guest of ProXad - France (110:300/1.1@linuxnet)