Image

Image

Search This Blog

Tuesday, April 19, 2011

VT6421 IDE RAID Controller "hotswap"

#!/bin/bash
case "$1" in
start)
echo "Starting sata-via module..."
modprobe sata_via
echo "sleep 5 sec..."
sleep 5
lsmod | if grep sata_via; then echo -e "sata-via module \e[01;32mIS\e[00m inserted"; else echo -e "sata-via module \e[01;31mNOT\e[00m loaded"; fi
echo -e "Module inserted. HDD \e[01;32mavailable\e[00m"
cat /proc/partitions
;;
stop)
echo "Removing sata-via module..."
rmmod sata_via 2>/dev/null
echo "sleep 5 sec..."
sleep 5
lsmod | if grep sata_via; then echo -e "sata-via module \e[01;32mIS\e[00m inserted"; else echo -e "sata-via module \e[01;31mNOT\e[00m loaded"; fi
echo -e "Module removed. \e[01;32mSafe\e[00m to extract HDD."
cat /proc/partitions
;;
status)
lsmod | if grep sata_via; then echo -e "sata-via module \e[01;32mIS\e[00m inserted"; else echo -e "sata-via module \e[01;31mNOT\e[00m loaded"; fi
;;
restart|reload)
$0 stop
$0 start
;;
*)
printf $"Usage: %s {start|stop|restart|status}\n"
exit 1
esac

No comments:

Post a Comment

Blog Archive