Pode ser um pouco exagerado, mas SystemTap
pode ajudar você a identificar o processo que está realizando E / S nesse disco.
Prepare o SystemTap
[root@localhost ~]# stap-prep
snip
Instalar script de rastreamento
[root@localhost ~]# cat >/tmp/traceio2.stp
#! /usr/bin/env stap
global device_of_interest
probe begin {
/* The following is not the most efficient way to do this.
One could directly put the result of usrdev2kerndev()
into device_of_interest. However, want to test out
the other device functions */
dev = usrdev2kerndev($1)
device_of_interest = MKDEV(MAJOR(dev), MINOR(dev))
}
probe vfs.write, vfs.read
{
if (dev == device_of_interest)
printf ("%s(%d) %s 0x%x\n",
execname(), pid(), ppfunc(), dev)
}
Descobrir o ID do dispositivo que você deseja monitorar, neste caso, vou monitorar / dev / sda5
[root@localhost ~]# df -k /
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda5 18141508 16293424 903496 95% /
[root@localhost ~]# ls -l /dev/sda5
brw-rw----. 1 root disk 8, 5 Jul 1 01:21 /dev/sda5
[root@localhost ~]#
Monitor, usando o maior número + menor (8,5) em hexadecimal. Encontre culpado. Alegra-te
[root@localhost ~]# /tmp/traceio2.stp 0x805
accounts-daemon(434) vfs_read 0x800005
accounts-daemon(434) vfs_read 0x800005
accounts-daemon(434) vfs_read 0x800005
lightdm(503) vfs_write 0x800005
bash(3036) vfs_read 0x800005
bash(3036) vfs_read 0x800005
^C
[root@localhost ~]#