« Family Tradition | Main | The price of balls »
February 11, 2005
Unmounting Filesystems
Help! I can't unmount this filesystem!
Well, the reason you can't unmount it (actually umount it - Unix spells it without an 'n') is usually because it is locked. Why is it locked? Because somewhere on that filesystem there is an open file. The questions is either which file or more likely which process. Sometimes you can look at the process table and guess but more faster and more useful is the fuser command. In particular (on Solaris):
fuser -cu filesystem-you-want-to-umount
will do the job very nicely. The 'c' means look "collectively" for everything below this point and the 'u' indicates that you want to know the "user" involved. What you will get back will be a list of process ids with the user id in brackets.
I often get asked what the 'f' stands for in fuser. Actually I am not sure but there are in fact four arguments to the command (on Solaris). They are carefully listed in the manpage in an unusual order. Instead of being alphabetic, the options are listed as:
- k (kill the processes)
- c (collect - as above)
- u (return the user id)
- f (use force)
Obviously another bit of strange Unix humour :-)
P.S. Before anyone mentions it, I am aware that the options are not the same under Linux (or indeed all versions of Solaris for that matter).
Posted by Ozguru at February 11, 2005 06:00 AM