Dear Experts,
Pl help me to fix this
i am trying to unmount the all the file systems in VG, Once unmounted vary off the VG.
I have written the script to do that it works fine when none of user or process id holds it but if in use it says resource is busy and can't unmount.
even i used fuser -kxus fs in the if statement but i am not able to can anybody help to how to assign the process ids holded by filesystem to a variable i am able to fetch the process id using "fuser -c <filesystem> it shows ids like below
<filesystem>: 1900636c 3207268c
how can i get only process id in to variable(i.e 1900636 3207268)
so i can add line script to kill process ids
Here it is script which i wrote to do the things.
lsvg -l `lsvg -o | grep -v "rootvg" ` | awk '{ print $7 }' | grep -vE "(^$|LV|N/A)" | sort -r > ${LOGFLDR}/tmp_vg.out
{
for i in `cat ${LOGFLDR}/tmp_vg.out`
do
umount -f $i
if [ $? -ne 0 ]
then
fuser -kxuc $i
umount -f $i
fi
done
for i in `lsvg -o | grep -v "rootvg"`
do
varyoffvg $i
done
} 1>${LOGFLDR}/FS-status_daily.log 2>&1
if [ $? -eq 0 ]
then
d=`date +"%d-%m-%Y %H:%M"`
echo "Succefully Completed Execution of flashunmount.bash at $d "
unset d
exit 0
else
echo "Error Occured during the execution of flashunmount.bash. Refer the log file created in "${LOGFLDR}""
fi
exit
Waiting for u u suggestion
Regards,
Madhu