1

I am looking for a "cat /proc/diskstats (from linux)" equivalent in solaris OS, to get disk stats such as reads per sec, writes per sec, kb reads per sec, kb writes per sec.

I tried iostat -xnp, but i guess its not giving me the complete information.

when i issues df -k, i could see only entry with partition name as /dev/dsk/* format, that is my CD drive.

Output of df -k:

Filesystem         1024-blocks Used   Available Capacity  Mounted on
/dev/dsk/c1t1d0s2  57632       57632        0   100%    /media/VBOXADDITIONS_5.0.14_105127

So, i am expecting an entry with c1t1d0s2 in iostat -xnp, but i dont see any.

Is iostat -xnp the right command for my problem?

jlliagre
  • 29,783
  • 6
  • 61
  • 72
Venkat Teki
  • 2,233
  • 4
  • 21
  • 28

1 Answers1

3

The iostat -xnp command is already providing all the information you requested.

The fact there is no specific line for c1t1d0s2 is due to the fact there is no partition table on the cdrom. Here, c1t1d0s2 is equivalent to the whole device so you get its statistics with iostat -xnp in the line referencing c1t1d0

$ iostat -xnp 5
                    extended device statistics              
    r/s    w/s   kr/s   kw/s wait actv wsvc_t asvc_t  %w  %b device
    7,6    5,1  329,3   68,6  0,1  0,1   10,0    5,3   4   6 c1t0d0
    0,0    0,2    0,1    0,0  0,0  0,0    0,0    0,0   0   0 c1t0d0s0
    7,6    4,9  329,3   68,6  0,1  0,1   10,2    5,4   4   6 c1t0d0s1
    0,0    0,0    0,0    0,0  0,0  0,0    0,0    0,0   0   0 c1t0d0p0
    0,0    0,0    0,0    0,0  0,0  0,0    0,0    0,0   0   0 c1t0d0p1
    0,0    0,0    0,0    0,0  0,0  0,0    0,0    0,0   0   0 sd0,h
    0,0    0,0    0,0    0,0  0,0  0,0    0,0    0,0   0   0 sd0,i
    1,1    0,0   33,0    0,0  0,0  0,0    0,0    0,7   0   0 c1t1d0

Beware that the first line is showing the average values since last boot so you should ask for two reports and pick the second one to get current statistics (e.g. iostat -xnp 1 2 for a one second sample).

jlliagre
  • 29,783
  • 6
  • 61
  • 72
  • Thanks! Here i have 2 steps, 1st step is get the partitions using "df -k" command, and considering the entries where name is starting with "/dev/dsk/". In my case, i installed a virtual box and imported solaris 11 image on top of that. I do not see any entries matching this pattern except my cdrom. This is the input to my second step(get disk stats). So, in order to choose the last row(in your example, with c1t1d0), is it a good idea to take the partition name from step 1(eg: c1t1d0s2), and check for a "device" name (in step 2) matching the name from step1? – Venkat Teki Feb 26 '16 at 10:06
  • Are you interested in all disks statistics or just the cdrom ones? Why are you using `df` in the first place? Linux `cat /proc/diskstats` doesn't show file system related information either. – jlliagre Feb 26 '16 at 10:15
  • I Am interested in all the disk statistics, not just cdrom. I was using df to get all the partitions(Correct me i am wrong). I am pretty new to solaris. – Venkat Teki Feb 26 '16 at 10:17
  • You are wrong expecting `df` to tell you what partitions are used for the reason already replied in your other thread http://stackoverflow.com/questions/35596905/listing-the-volumes-on-solaris-os. By the way, stackoverflow is not really the right place for such questions. You should have posted them in unix.stackexchange.com – jlliagre Feb 26 '16 at 10:36