Tracing continuous drive activity
Right now, EasyOS is running, installed on the 8TB hard drive in
my Lenovo PC, and there is a quiet sound of periodic drive activity.
This hardly ever stops, even if the desktop is running but no
applications, there is the "brrp brrp" of the hard drive.
This happens also when running EasyOS off a USB Flash stick, quietly, with the LED flashing on the drive.
I thought that the 'iotop' utility would be most useful to trace what
processes are accessing the drive. Reads I don't mind, but writes are a
problem with Flash storage. However, iotop requires the kernel to be
compiled with I/O Accounting enabled, so I compiled the 5.4.47 kernel,
with these enabled:
General setup
CPU/task time and stats accounting
[*] Export task/process statistics through netlink CONFIG_TASKSTATS
[*] Enable per-task delay accounting CONFIG_TASK_DELAY_ACCT
[*] Enable extended accounting over taskstats CONFIG_TASK_XACCT
[*] Enable per-task storage I/O accounting CONFIG_TASK_IO_ACCOUNTING
First time that I ran "iotop -o -a", there were two processes writing to the hard drive, "pmcputemp" and "jbd2/sda4-8".
pmcputemp is the tray applet monitoring CPU temperature. Why is it
frequently writing to the drive? I killed it, and ran Screeny to take a
snapshot of iotop output:
That "jbd2/sda4-8" looks like the culprit. It is the "Journal Block Device", that is, writing to the ext4 journal.
It used to be, that I ran the working partition without journal, when
running off a Flash drive, but early this year enabled the journal, as
it ensured a "clean" shutdown of the ext4 filesystem -- there is a blog
post about that.
All right, writing to the journal is the culprit, but is that a bad
thing? On a Flash drive, will that be hammering the same memory
locations?
I don't know anything about this "jbd2/sda4-8" process yet. Why the
"4-8", as the drive has partitions 1-9? sda4 is the working partition.
sda1 and sda4 are mounted, the others aren't.
Very interesting, the drive is now quiet. No, one little "brrp", due
to "jbd2/sda4-8". Quiet again. So, the writes do slow down, eventually
-- still getting them, just less frequent.
EDIT 2020-06-21:
Well, either "pmcputemp" or "jbd2/sda4-8" can be causing more writes. If
do nothing, just stare at the desktop, it is the former, if do some
desktop activity, it is the latter. Anyway, here is the next post, where
I have solved the problem of pmcputemp writing to the drive:
https://bkhome.org/news/202006/pmcputemp-modified-to-remove-drive-writes.html
Tags: easy