ls -l /dev/disk/by-uuid
for i in /dev/sd{a..m}; do result=$(sudo smartctl -a $i | grep Serial\ Number); echo "$i : $result"; done
awk '/UUID/ {split($1,a,"=");print a[2];}' /etc/fstab awk '/(^|#\s+)UUID/ {split($1,a,"="); print a[2]; }' /etc/fstab
/dev/disk/by-uuid/{{insert uuid here}}
for i in $(awk '/(^|#\s+)UUID/ {split($1,a,"="); print a[2]; }' /etc/fstab); do result=$(sudo smartctl -i /dev/disk/by-uuid/$i | grep Serial | cut -d' ' -f5-20); echo UUID: "$i -> Serial: $result"; doneClass A are raided so need to get some info:
/opt/MegaRAID/MegaCli/MegaCli64 -pdlist -a0 | grep 'Device Id'
Reading the SMART values of the drive in RAID
The use of smartmontools enables direct access to the physical drive behind the controller, eg. for the first drive. First of all, the device id needs to be determined with the megacli tool:
megacli -pdlist -a0| grep 'Device Id’
sudo smartctl -d megaraid, -a /dev/sda
http://wiki.hetzner.de/index.php/LSI_RAID_Controller/en
https://www.thomas-krenn.com/en/wiki/Smartmontools_with_MegaRAID_Controller