I was recently working w/ NFS restores from a tape drive. When I went to unmount the filesystem from the client machine it refused to let me do so. I thought for sure I'd end up having to reboot the machine as some service seemed to have some bizarre problem.
The next day, my "root" session having expired in my shell, I realized that as the unpriveleged user 'scole' my cwd was /mnt/whatever, the same one I had been trying to unmount. I had switched to root from there and my prompt, therefore, didn't tell me I was actually in that directory.
Realizing my fumble I quickly conducted a test session to determine how I might know this was the problem in the future. Sure enough, 'lsof' was able to tell me WHO was in that dir (the unpriveleged shell, in this case).
I guess it's one of those things where you just want to say 'duh' once you figure it out, but it's not so entirely obvious when you're in the midst of the situation.
The next day, my "root" session having expired in my shell, I realized that as the unpriveleged user 'scole' my cwd was /mnt/whatever, the same one I had been trying to unmount. I had switched to root from there and my prompt, therefore, didn't tell me I was actually in that directory.
Realizing my fumble I quickly conducted a test session to determine how I might know this was the problem in the future. Sure enough, 'lsof' was able to tell me WHO was in that dir (the unpriveleged shell, in this case).
I guess it's one of those things where you just want to say 'duh' once you figure it out, but it's not so entirely obvious when you're in the midst of the situation.