Created
March 6, 2014 19:16
-
-
Save nyov/9397285 to your computer and use it in GitHub Desktop.
ata controller to disk mappings (e.g. ata0 has sda)
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
#!/bin/sh | |
# ata bus to harddisk mappings | |
for device in `ls /sys/block/ | grep '[hs]d'`; do | |
host=`ls /sys/block/${device}/../../../../scsi_host/` | |
unique_id=`cat /sys/block/${device}/../../../../scsi_host/${host}/unique_id` | |
echo "ata${unique_id} is scsi_host ${host} with attached device ${device}" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment