Linux HDD Activity

Hey Guys!

I’ve been looking at purchasing the 8 x blinkstrip, as a way to monitor my headless Debian server. So far I’ve found explanations in the forum for all my questions of application support, such as CPU usage, brightness control etc, however I can’t find anything on my last requirement… HDD activity?

I have a software RAID 1 on an external networked SAN using mdadm, which I use for automated ‘cloud’ backups from my phone, ultimately what I’d like to have the blinkstrip do is indicate whenever there is activity (read/write) on the mounted drive - can someone please let me know if this is possible?

Many thanks,
Iain.

1 Like

I think you want /sys/block/sda/stat

https://www.kernel.org/doc/Documentation/block/stat.txt

Playing around a bit, the gist of it is that you need to read that file, and pick out the 1st and 5th values, those are IO read and write request counts. You might also do the 3rd and 7th to do number of read/written sectors instead of requests overall. You should be able to watch for those to increase, then flicker a light when it goes above whatever limit you like. Or if it changes at all even.

Aahhh excellent. Thanks very much, I was beginning to lose hope! :rofl: …once I’ve got one and programmed it up I shall be sure to let you know how it went. :blush: