1753861 Members
7538 Online
108809 Solutions
New Discussion юеВ

Mount directory

 
ivychung2
Frequent Advisor

Mount directory

I have a system mount from host B and host A , sometimes when I reboot the server , they are disconnect , I need to mount it manually , but sometimes I forgot to do it , how can I make sure they are mount , eg . a checking of the mount is vaild or not , if it is not mount , it will send me a mail , is it possible ? please advise .
4 REPLIES 4
Peter Godron
Honored Contributor

Re: Mount directory

Hi,
please read :
http://forums1.itrc.hp.com/service/forums/helptips.do?#28

0 points for 33 answers !

possible solution:
nfs softmount, then after some time check whether mount point is valid and send email
RAC_1
Honored Contributor

Re: Mount directory

Before you mount it, use script. This script will mount it, if it is not mounted, else give alert that it is mounted. Another option is to use automount.
Script like follows. (Not tested)

mount_a='servera:/dir1'
mount_b='serverb:/dir2'
mount_pt1='/some_dir1'
mount_pt='/some_dir2'

mount -p | grep '\/some_dir1'
if [$? -eq 0];then
echo "already mounted"
else
mount -F nfs servera:/dir1 /some_dir1
fi
There is no substitute to HARDWORK
Yogeeraj_1
Honored Contributor

Re: Mount directory

hi,

after mounting your remote systems, you should have made it permanent by modifying your fstab accordingly so that it woould be mounted automatically next time you restart your server.

if you are not sure, use SAM -> Networking and Communications->Networked File Systems -> Mounted Remote File Systems

and mount your remote file systems!

hope this helps!

yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Muthukumar_5
Honored Contributor

Re: Mount directory

Using scripting is good.

#!/bin/ksh
mount_list="/tmp/mnt1 /tmp/mnt2"
set -A mount ${mount_list}

index=0

while [[ ${index} -lt ${#mount[*]} ]]
do

mount -p | grep -wEq "${mount[$index]}"
if [[ ${?} -eq 0 ]]
then
echo "Mount ${mount[$index]} is available"
else
echo "Mount ${mount[$index]} is not available" | mailx -s "Error: Mount" userid@domainname.com
fi

let index=index+1
done

Note: You can add mount hostA:/exportfs /mount will work too.

--
Muthu
Easy to suggest when don't know about the problem!