#!/bin/bash


function kill_process(){

ID=`ps -ef | grep $1 | grep -v grep | awk '{print $1}'`
#echo $ID
for id in $ID
do
kill -9 $id
echo "kill $id"
done
}

echo ***********kill lvm process start***********
kill_process /opt/tool/saturn-cycle-c
kill_process /opt/tool/saturn-collect

lvmpid=$(lsof |grep /opt/storage/ |awk '{print $1}')
for pid in $lvmpid
do
echo kill $pid
kill -9 $pid
done

echo ***********kill lvm process end***********

sleep 5

echo ***********umount start***********
umount /opt/storage
umount /dev/sde2
echo ***********umount end***********

fsck -y /dev/sda1
fsck -y /dev/sdb1
fsck -y /dev/sdc1
fsck -y /dev/sdd1
fsck -y /dev/sde1
fsck -y /dev/sde2
fsck -y /dev/sde3

