Process using/creating files in the filesystem

Hello Team,

In a application filesystem, there is a process keep creating the log files. Due to that the filesystem keep getting full. Please let me know how to identify the process which is keep writing in the filesystem.

fuser -u <FS> will show only the user who using the filesystem. Abort from that any other method to identify ?

FYI: LSOF is not there.

Thanks,
Gowtham.G

If you know the user already you could use ps -u <user> to identify this users processes, no? fuser -u will report on process numbers too, btw. (the user names are just additional information), so you can search for these in the output of ps too.

Further, instead of broad-brushing with fuser -u <FS> you can fine-grain your report by identifying the file in question (should not be too hard when it is threatening to fill up the FS, but even if it is: use the -c switch of fuser to get a report on open files) and then issuing fuser -u </file/in/question> instead. Use the -V switch for fuser to get a more verbose output and use the -f switch to report on open files. You can use fuser -k even to kill processes having opened the respective file(s).

I won't comment on ways to remember the relevant switches -c , -f , -k and -u but i'd like to suggest that sometimes a quick glance in the man page of the command one doesn't know how to use sure helps.

I hope this helps.

bakunin

1 Like

Hi,

please try fuser -c <dir> .

Regards

PS
Uhh bakunin was faster than me :wink:

1 Like

Thank you Bakunin/Xray,

I sort it out using below command. Below command will give the process which holding the Filesystem. I have killed the process the filesystem has become normal.

fuser -xc <filesystem>