Trace the process responsible for locking filesystem ?

Hi,

Sometimes when I want to unmount some filesystem I get "The requested resource is busy." error.
In such a case I try to find and kill process that uses that filesystem. I do that on random.

Is there a right way to find whitch prosesses use filesystem resource at given time ?

thanks
Vilius

Try

fuser -u /yourfilesystem

to get the PID, or try

lsof | grep yourfilesystem

to get a clue which process it could be.