Advertisement
Guest User

Untitled

a guest
Feb 17th, 2015
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. drives="da0 da1 da2 da3 da4 da5 da6 da7 da8 da9 da10 da11 da12 da13 da14"
  4. # Note that you can replace this line -^ by this line -v to print the array for all the drives
  5. # drives=`sysctl -n kern.disks | awk '{for (i=NF; i!=0 ; i--) print $i }'`
  6.  
  7. echo ""
  8. echo "+========+============================================+=================+"
  9. echo "| Device | GPTID | Serial |"
  10. echo "+========+============================================+=================+"
  11. for drive in $drives
  12. do
  13. gptid=`glabel status -s "${drive}p2" | awk '{print $1}'`
  14. serial=`smartctl -a /dev/${drive} | grep "Serial Number" | awk '{print $3}'`
  15. printf "| %-6s | %-42s | %-15s |\n" "$drive" "$gptid" "$serial"
  16. echo "+--------+--------------------------------------------+-----------------+"
  17. done
  18. echo ""
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement