rageek

A place for Unix Thoughts and Ideas

List all Storage with Size on Solaris

Here is a quick one liner for listing all the storage configured in server and the size of the storage

It prints out the size in GB and MB, which is handy for my small LUNs which are using for fencing.

for c in $(iostat -En | grep Soft | awk ‘{print $1}’ | cut -d t -f1 | sort | uniq); do for i in `iostat -En | grep Soft | awk ‘{print $1}’ | grep “$c”`;do SZ=$(iostat -En $i | grep Size | cut -d'<‘ -f2); echo “$i ${SZ%% *}” | awk ‘{printf ( “%s %2d GB ( %d MB)\n”, $1, $2/1024/1024/1024+.05, $2/1024/1024+.05) }’; done | sort -t d +1 -n; done

Here is the output from a T5120 in a RAC cluster.

root@testserver # for c in $(iostat -En | grep Soft | awk ‘{print $1}’ | cut -d t -f1 | sort | uniq); do for i in `iostat -En | grep Soft | awk ‘{print $1}’ | grep “$c”`;do SZ=$(iostat -En $i | grep Size | cut -d'<‘ -f2); echo “$i ${SZ%% *}” | awk ‘{printf ( “%s %2d GB ( %d MB)\n”, $1, $2/1024/1024/1024+.05, $2/1024/1024+.05) }’; done | sort -t d +1 -n; done
c0t0d0 0 GB ( 0 MB)
c1t0d0 136 GB ( 140009 MB)
c1t1d0 136 GB ( 140009 MB)
c2t50060E800547725Dd0 0 GB ( 90 MB)
c2t50060E800547725Dd1 0 GB ( 90 MB)
c2t50060E800547725Dd2 0 GB ( 90 MB)
c2t50060E800547725Dd3 0 GB ( 500 MB)
c2t50060E800547725Dd4 50 GB ( 51200 MB)
c2t50060E800547725Dd5 10 GB ( 10240 MB)
c2t50060E800547725Dd6 10 GB ( 10240 MB)
c2t50060E800547725Dd7 50 GB ( 51200 MB)
c2t50060E800547725Dd8 500 GB ( 512000 MB)
c2t50060E800547725Dd9 10 GB ( 10240 MB)
c2t50060E800547725Dd10 10 GB ( 10240 MB)
c2t50060E800547725Dd11 1023 GB ( 1048000 MB)
c3t50060E800547724Dd0 0 GB ( 90 MB)
c3t50060E800547724Dd1 0 GB ( 90 MB)
c3t50060E800547724Dd2 0 GB ( 90 MB)
c3t50060E800547724Dd3 0 GB ( 500 MB)
c3t50060E800547724Dd4 50 GB ( 51200 MB)
c3t50060E800547724Dd5 10 GB ( 10240 MB)
c3t50060E800547724Dd6 10 GB ( 10240 MB)
c3t50060E800547724Dd7 50 GB ( 51200 MB)
c3t50060E800547724Dd8 500 GB ( 512000 MB)
c3t50060E800547724Dd9 10 GB ( 10240 MB)
c3t50060E800547724Dd10 10 GB ( 10240 MB)
c3t50060E800547724Dd11 1023 GB ( 1048000 MB)

Advertisements

One response to “List all Storage with Size on Solaris

  1. Pingback: Mapping OS Devices to Veritas Device names in Veritas 5.1 « rageek

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: