Wednesday, April 04, 2007

Determine Processes Accessing a File System

I was trying to unmount the /opt filesystem today, but I was prompted with a "device busy" message. Frankly speaking, I thought the file system was already in an inactive state, so I was curious as to what processes were hanging it. These processes were identified and subsequently killed.

# cd /
# umount /opt (device busy)

After realizing that processes were still accessing the /opt filesystem, here's what was done to umount it.

Determine which processes were accessing /opt
# cd /
# fuser -cu /opt
# kill -9 PID1 PID2
umount /opt

Alternately, this could have been done, too.

# cd /
# fuser -ck /opt
# umount /opt

or simply force it

# cd /
# umount -f /opt


Anonymous said...

Thank You!

I found it really helpful..

esofthub said...

nambi, I'm glad you found it useful.