Linux – how to find what files are process using

I have experienced problem with bacula file daemon client which were backing-up files and randomly frozen. So I was thinking – why?

One think which was really weird to me that back-up speed went down from 8MB/s to 100kB/s and I just wanted to know what is happening with back-up client. So I investigated.

ps aux | grep bacula
root 4633 51.3 0.1 422348 9424 ? Ssl 17:18 4:41 /usr/sbin/bacula-fd -f -c /etc/bacula/bacula-fd.conf -u root -g root

So you see, I got 4633 process id and listed processes opened files

# ls -l /proc/4167/fd
total 0
lr-x------ 1 root root 64 Oct 16 17:06 0 -> /dev/null
lrwx------ 1 root root 64 Oct 16 17:06 1 -> socket:[27399]
lr-x------ 1 root root 64 Oct 16 17:06 10 -> /var/lib/docker
lr-x------ 1 root root 64 Oct 16 17:06 11 -> /var/lib/docker/devicemapper
lr-x------ 1 root root 64 Oct 16 17:06 12 -> /var/lib/docker/devicemapper/devicemapper
lr-x------ 1 root root 64 Oct 16 17:06 13 -> /var/lib/docker/devicemapper/devicemapper/data
lrwx------ 1 root root 64 Oct 16 17:06 2 -> socket:[27399]
lr-x------ 1 root root 64 Oct 16 17:06 3 -> /run/bacula-fd.9102.pid (deleted)
lrwx------ 1 root root 64 Oct 16 17:06 4 -> socket:[27408]
lrwx------ 1 root root 64 Oct 16 17:06 5 -> socket:[27414]
lrwx------ 1 root root 64 Oct 16 17:06 6 -> socket:[27420]
lr-x------ 1 root root 64 Oct 16 17:06 7 -> /
lr-x------ 1 root root 64 Oct 16 17:06 8 -> /var
lr-x------ 1 root root 64 Oct 16 17:06 9 -> /var/lib

Can you see it what causes a problem? It is a docker storage, so I excluded it and it went fine.