I want metrics for how much writing and reading have been done to a folder.
vmstat -d
gives metrics at the whole disk level. iotop
will give per process rw stats.
But how can I find out how much writing has been done to a folder or file?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityGiven the clarification in the comment - the need of knowing how much data is being sent to the underlying block device (e.g. for the purposes of logging activity on SSD) - you'd need to check this in the file system driver and below (which usually is part of the kernel). Note, that just writing to a file doesn't mean the data gets really sent or even written to the device - there usually is lots of caching between the write()
system call in user space and the actual bits making it into the wires connecting the hard drive to the controller.
du -sx
invocations?