# Hard Disks Statistics

## deurk

Any idea on how to get statistics of the hard drives like bytes read/written on, loadavg, things like that?

Thanks.

----------

## Qux

Did you try gkrellm ?

----------

## robdavies

emerge sysstat

iostat 5

----------

## bassvandijk

Try hdparm.

A nice article about it on oreilly:

http://linux.oreillynet.com/pub/a/linux/2000/06/29/hdparm.html

----------

## deurk

 *bassvandijk wrote:*   

> Try hdparm.
> 
> A nice article about it on oreilly:
> 
> http://linux.oreillynet.com/pub/a/linux/2000/06/29/hdparm.html

 

No, that's not what I need, I meant statistics, not tweaking  :Wink: 

----------

## bassvandijk

 *deurk wrote:*   

> No, that's not what I need, I meant statistics, not tweaking 

 

Try:

> hdparm -Tt /dev/hda

You'll see something like:

/dev/hda:

 Timing buffer-cache reads:   128 MB in  1.34 seconds =95.52 MB/sec

 Timing buffered disk reads:  64 MB in 17.86 seconds = 3.58 MB/sec

But if you want to see your stats in a graph then I would advice gkrellm or superkaramba.

----------

## deurk

 *robdavies wrote:*   

> emerge sysstat
> 
> iostat 5

 

Great!

Thx rob  :Wink: 

----------

## deurk

 *bassvandijk wrote:*   

> 
> 
> Try:
> 
> > hdparm -Tt /dev/hda
> ...

 

I see what you meant... but it's not supposed to change over time (cause disks are supposed to be as fast all the time) but I wanted to graph actual load of the disks, like how many bytes were written, how to still write, and stuff like this...

----------

## laika

What you want is the app-admin/sysstat ebuild.  From that you can use iostat to gather the I/O statistics you want.  With a little shell scripting and cron scheduling you should be able to automate the whole shebang..

Also here's the home of the sysstat utilities, where the author gives some tips on automation: http://perso.wanadoo.fr/sebastien.godard/

-jp

----------

## deurk

Hmmm I'm wondering why I don't get any datas from my hard drives... (IDE)

Here is an output of iostat:

Linux 2.4.20-gentoo-r6 (vilya)  09/13/03

avg-cpu:  %user   %nice    %sys   %idle

           5.25    2.27    2.95   89.54

Device:            tps   Blk_read/s   Blk_wrtn/s   Blk_read   Blk_wrtn

Strange isn't it??

Any idea why my disks aren't appearing here?

----------

## laika

What is the output of iostat -x

----------

## deurk

nothing more actually... still no disk present

----------

## laika

My last trick...

```
iostat -x /dev/ide/host0/bus0/target0/lun0/disk
```

Assuming, of course, this is the master on the primary IDE bus.

If you still don't have any output, my only guess is that you didn't build your kernel to include /proc ( kernel configuration, under filesystem options ) or that you are really using an ATA-1xx interface, and I have not tested iostat using ATA yet.

Hopefully someone here will have some further insight.  But do check to make sure the /proc/ide file structure is present and contains something remotely accurate.

----------

## Nermal

hrmm.. from the iostat man page

 *Quote:*   

> If no device is given on the command line, then extended  statistics  are  displayed  for  every device registered in the /proc/partitions file. Please note that Linux kernel needs to be patched for this option to work.

 

----------

## laika

You may have it there, but I have used iostat with the 2.4.20-r5 sources, which he sites in his sig.  Though he may need to check the per partition kernel settings...

```

/usr/src/linux/.config

#

# Block devices

#

CONFIG_BLK_STATS=y

#

```

Now that I think of it, that is most likely the issue here... Try that out  :Smile: 

----------

## laika

Any update?  Did you check your kernel config?  Hope that was it!  Good Luck!

----------

