NFS Mount Verification - NFS

This is a discussion on NFS Mount Verification - NFS ; I am trying to use an NFS mount from a production server, mounted at /application/archive/images on the client. Everything is working great. The problem is that when the NFS mount is not mounted on the client, there is still a ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: NFS Mount Verification

  1. NFS Mount Verification

    I am trying to use an NFS mount from a production server, mounted at
    /application/archive/images on the client. Everything is working
    great. The problem is that when the NFS mount is not mounted on the
    client, there is still a /application/archive/images directory. My
    application could inadvertantly copy files into this directory, which
    is on the local machine.

    Is there any way to periodically 'ping' the nfs mount to verify that
    it is in fact up and running? I thought about scripting something to
    use the output of df, but am looking for something a little more
    robust.

    Thanks,

    Mark

  2. Re: NFS Mount Verification

    mark-wyckoff@inoveon.com (bug892) wrote in message news:<98919f0.0402170844.609c7cc9@posting.google.com>...
    > I am trying to use an NFS mount from a production server, mounted at
    > /application/archive/images on the client. Everything is working
    > great. The problem is that when the NFS mount is not mounted on the
    > client, there is still a /application/archive/images directory. My
    > application could inadvertantly copy files into this directory, which
    > is on the local machine.
    >
    > Is there any way to periodically 'ping' the nfs mount to verify that
    > it is in fact up and running? I thought about scripting something to
    > use the output of df, but am looking for something a little more
    > robust.


    The most robust would be to copy the files to subdirectory of
    /application/archive/images (e.g. /application/archive/images/subdir)
    one which does not exist if the NFS mount is not mounted on
    /application/archive/images. That way, the file copy will fail
    if subdir is not present. YInstead of using df, you could then
    use a /bin/sh shell script fragement like:

    if [ ! -d /application/archive/images/subdir ]
    then
    mount server:/export/images /application/archive/images
    if [ $? -ne 0 ]
    then
    echo mount failed
    exit 1
    fi
    fi

    # proceed with file copy


    Another approach is to use the automounter, which will trigger a mount
    when it isn't mounted. Be sure to specify the "retry=" option.
    Automounters use a default of 0 for retry=. So automounters
    will by default make one attempt and give you. You want it
    to be lot more persistent than that. The Solaris manual mount command
    defaults retry= to 10000 so use at least 10000

    >
    > Thanks,
    >
    > Mark


+ Reply to Thread