Tanti Technology

My photo
Bangalore, karnataka, India
Sandeep Kumar | Founder, Tanti Technologies At Tanti Technologies, I share practical knowledge, hands-on tutorials, and real-world solutions across Python, SQL, Docker, Kubernetes, CI/CD, AWS, Azure, Machine Learning, Generative AI, and Agentic AI. My mission is to simplify complex technologies and provide actionable insights that help developers, engineers, and businesses learn faster, build better, automate smarter, and innovate with confidence. 🚀 Learn • Build • Automate • Innovate Follow Tanti Technologies for practical technology insights and next-generation AI solutions.

Monday, 28 April 2014

AIX Basics: fuser


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