Friday, November 7, 2014

Total size of all disk presented to a UNIX server

I needed a way to add up the total storage presented to a few UNIX machines. Here's what I came up with:

# iostat -En | grep Size | awk {'print $6'} | sed s/GB// | awk '{s+=$1} END {print "Total Storage: "s "GB"}'

The result is:

Total Storage: 8398.69GB

No comments:

Post a Comment