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 https://unix.stackexchange.com/questions/55212/how-can-i-monitor-disk-io ... 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 Answers1

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

sourcejedi
  • 50,249