|
Here's one tip for mounting
NFS shares on Solaris that you may be able to adapt (keep in mind that
Solaris calls the fstab vfstab, its standard response to ping requests,
and the like):
#!/bin/sh SIGN=0 mount | grep ":/" | nawk '{ print $1,$2,$3 }' | sort >>/tmp/nfs_list.txt for i in `grep nfs /etc/vfstab | egrep -v "^#" | nawk '{ print $3 "*on*" $1 }' | sort`; do JJ=`echo "$i" | sed -e 's/\*/ /g` MNT_TRY=`echo "$JJ" | nawk '{ print $1 }'` SRVR=`echo "$JJ" | nawk '{ print $3 }' | nawk '{ FS=":"; print $1 }'` CK_MNT=`egrep -c "$JJ" /tmp/nfs_list.txt` if [ $CK_MNT -lt 1 ]; then echo "NO MOUNT: $JJ" PINGIT=`/usr/sbin/ping $SRVR 1 | grep -c "alive"` if [ "$PINGIT" = "1" ]; then mount $MNT_TRY CHK2=$? if [ $CHK2 -ne 0 ]; then echo "FAILED: 2nd mount attempt for $JJ--Check availability!" else echo "SUCCESS: Mount Attempt for $JJ" fi else echo "Mount source $SRVR: no response to ping!" echo "FAILED: mount attempt for $JJ!" fi SIGN=1 else CK_STALE=`ls -l $MNT_TRY` if [ "$CK_STALE" = "" ]; then umount -f $MNT_TRY PINGIT=`/usr/sbin/ping $SRVR 1 | grep -c "alive"` if [ "$PINGIT" = "1" ]; then mount $MNT_TRY CHK2=$? if [ $CHK2 -ne 0 ]; then echo "FAILED: Mount attempt for stale $JJ--Check availability!" else echo "SUCCESS: Remount attempt for stale $JJ" fi else echo "Mount source $SRVR: no response to ping!" echo "FAILED: mount attempt for $JJ!" fi SIGN=1 fi fi done if [ $SIGN -eq 0 ]; then echo "All /etc/vfstab NFS Mounts O.K." else echo "\n/etc/vfstab NFS mounts O.K. except as marked 'FAILED' above" fi rm -f /tmp/nfs_list.txt |
|
See Also
Have a Linux Problem
Linux Books
Home Index
(c) www.gotothings.com All material on this site is Copyright.
|