Which kjournald process belongs to which filesystem?
I understand that each mounted ext3
filesystem will have a corresponding kjournald
process running. One of those processes is using lots of CPU, and I'd like to know which filesystem is responsible.
I have three ext3
filesystems mounted, but the processes appear only as
root 325 2 0 Sep23 ? 00:30:12 [kjournald]
root 7433 2 0 Sep23 ? 00:00:00 [kjournald]
root 7434 2 0 Sep23 ? 00:09:47 [kjournald]
How can I determine which process is associated with which filesystem?
An indirect way to do this is to use blktrace
and its convenience command btrace
. blktrace
records and displays block-level access to disks as it happens. btrace
means you don't have to remember all the options to blktrace
.
# btrace /dev/sda1 | grep kjournald
8,1 5 1 0.000201850 325 Q WS 451573976 + 8 [kjournald]
8,1 5 2 0.000393849 325 Q WS 976637584 + 8 [kjournald]
8,1 5 3 0.000398641 325 Q WS 976637592 + 8 [kjournald]
8,1 5 4 0.000401003 325 Q WS 976637600 + 8 [kjournald]
8,1 5 5 0.000404179 325 Q WS 976637608 + 8 [kjournald]
8,1 5 6 0.000407446 325 Q WS 976637616 + 8 [kjournald]
^^^
pid of kjournald for /dev/sda1
The fields displayed here are documented in the blkparse
manpage; the fifth field is the PID of the process doing the I/O. So although I don't have a way of directly relating kjournald
s to filesystems, I can see which process is associated with a specific block device and then look at the mount table to see which filesystem is implicated.