Advertisement
Biduleohm

Drives identification infos (SATA)

Mar 4th, 2015
4,276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.63 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. drives="da0 da1 da2 da3 da4 da5 da6 da7"
  4.  
  5. echo ""
  6. echo "+========+============================================+=================+"
  7. echo "| Device | GPTID                                      | Serial          |"
  8. echo "+========+============================================+=================+"
  9. for drive in $drives
  10. do
  11.     gptid=`glabel status -s "${drive}p2" | awk '{print $1}'`
  12.     serial=`smartctl -i /dev/${drive} | grep "Serial Number" | awk '{print $3}'`
  13.     printf "| %-6s | %-42s | %-15s |\n" "$drive" "$gptid" "$serial"
  14.     echo "+--------+--------------------------------------------+-----------------+"
  15. done
  16. echo ""
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement