Created
August 3, 2023 01:01
-
-
Save mark99i/5e3892b16aab735a1b72835bf8496d79 to your computer and use it in GitHub Desktop.
Simple script for generate start/stop blink drive command on LSI SAS3 HBA controllers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [ -z "$1" ] | |
then | |
echo "Select drive: $0 /dev/sdx" | |
exit 1 | |
fi | |
echo "" | |
drive_serial=$(hdparm -I $1 | grep 'Serial Number' | cut -d':' -f2 | xargs) | |
echo -e "Drive info:" | |
echo -e "\tos path: $1" | |
echo -e "\tserial: $drive_serial" | |
drive_info=$(storcli /call/eall/sall show all | grep -B6 $drive_serial) | |
drive_path=$(echo -e "$drive_info" | grep 'Device attributes' | cut -d' ' -f2) | |
drive_model=$(echo -e "$drive_info" | grep "Model Number" | cut -d'=' -f2 | xargs) | |
echo -e "\tmodel: $drive_model" | |
echo -e "\tphy path: $drive_path" | |
echo "" | |
echo "" | |
echo -e "Start locate command:\n\tstorcli $drive_path start locate\n" | |
echo -e "Stop locate command:\n\tstorcli $drive_path stop locate\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment