Removing files and unmounting file systems in unix should always be preceded by the ‘fuser’ command. Too many times I see situations where an application has a file or files opened and they are removed from the file system. This causes even greater disparity between the ‘du’ and ‘df’ commands and confusion in general.
The filesystem will not release file space until the process in question has closed it. ’df’ reflects this and ‘du’ does not. The ‘-d’ option will aid in troubleshooting this situation:
# df -g
..
/dev/logicalv 72.00 0.00 100% 13579 96% /filesystem
..# du -s /filesystem
32671176 /filesystem# fuser -d /filesystem
/filesystem 123456
In this situation, process 123456 has a deleted file open from /filesystem. Ideally, the admin would have done the following before deleting a file:
# fuser /filesystem/file
/filesystem/file: 123456
This shows that process 123456 is using the file. Before deleting the file it needs to be released.
‘fuser’ can also be used to terminate all processes using a filesystem. This should only be used when permission has been obtained to bring the application down.
# fuser -kxuc /filesystem/file
This will kill all processes using /filesystem/file.
No comments:
Post a Comment