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.
Asked
Active
Viewed 228 times
0

Mikhail Morfikov
- 10,549
1 Answers
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
-
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
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:59iostat
looks promising, but I have to test that. – Mikhail Morfikov Sep 19 '19 at 20:49iostats
are reset after system reboot, so none of the three. – Mikhail Morfikov Sep 19 '19 at 22:57