0

There's a tool called vnstat which can monitor how much data you send/receive via network interfaces over time. Is there a similar tool for hdd/ssd disks? Basically I just want to know how much data I write to my disks daily/monthly/yearly.

  • Would dstat iotop and/or iostat be the kind of tools you are looking for? – kemotep Sep 19 '19 at 19:34
  • There are a lot of them. sar/sysstat is a traditional one, but there are many newer, prettier, more user-friendly tools. A related question (which mentions only a tiny portion of the available tools) is unix.stackexchange.com/questions/55212/… ... It's really hard to answer your question just because there are so many options available, in complexity ranging from things like dstat all the way up to feeding hundreds of machines worth of data into a time-series DB. It's not as daunting as "is there a program to edit text files?", but... – derobert Sep 19 '19 at 19:59
  • What's hard? I just want to know the total GiB my disk write/read each day/month/year, similar to the SSD feature. iostat looks promising, but I have to test that. – Mikhail Morfikov Sep 19 '19 at 20:49
  • @kemotep The iostats are reset after system reboot, so none of the three. – Mikhail Morfikov Sep 19 '19 at 22:57
1

If you're using the default filesystem type - and you don't mind scripting something yourself to log the cumulative values :) - there's a feature of ext4 that's convenient for this:

sudo tune2fs -l $DEVICE shows a "Lifetime writes" field. Or you can use cat /sys/fs/ext4/$DEVICE/lifetime_write_kbytes

| improve this answer | |
  • It's a good solution for an ext4 file system, but I need the value for the whole disk -- it also has the SWAP partition. – Mikhail Morfikov Sep 19 '19 at 22:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.