Last active
July 5, 2019 20:49
-
-
Save rickardrosen/2effa5e5b65a4d8fb26b9ef001063be4 to your computer and use it in GitHub Desktop.
Locate drive
This file contains hidden or 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
#!/bin/bash | |
udevadm info --query=all --name=/dev/$1 | grep -A3 -B9 SERIAL | |
pos=($(sas2ircu 0 display | grep -B9 $(udevadm info --query=all --name=/dev/$1 | grep ID_SCSI_SERIAL | awk -F "=" '{print $2}') | grep -Ei 'Enclosure|Slot' | awk -F ":" '{print $2}' | tr -d [:blank:])) | |
sas2ircu 0 locate ${pos[0]}:${pos[1]} ON |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment