When I do
sudo umount /media/KINGSTON
I got
umount: /media/KINGSTON: device is busy.
I close all the windows and make sure all shell are pointing to other directories. How can I find which process is preventing the umount?
|
When I do
I got
I close all the windows and make sure all shell are pointing to other directories. How can I find which process is preventing the umount? |
|||||||
|
|
open a terminal:
It will output something like this:
This will give you the pid of the processes using this volume. The extra character at the end of pid will give some extra info. ( c in 3106c) c - the process is using the file as its current working directory So to unmount just kill that pids and re-try the unmount
Note: To find the exact application name of these pids you may use this command
For example : this will output something like below.
Hope this will help |
|||||||||||
|
|
The most useful tool is lsof
If you run this command as an ordinary user, it will only show your own processes¹. Run The output from
The
There is no mechanical way to locate the window where a file is open (this is in fact not technically meaningful: if a process has several windows, a file is not particularly associated with one window or another), nor even any simple way of identifying a process's window (and of course a process doesn't have to have any windows). But usually the command name and file name are enough to locate the offender and close the file properly. If you can't close the file and just want to end it all, you can kill the process with There is a GUI for lsof, glsof, but it's not quite ready for prime time yet, and isn't packaged for Ubuntu so far. ¹
Lsof can list some information about other users's processes, but it doesn't detect the mount point so won't list them if you specify a mount point.
|
|||
|
|
|
Also this can help: lsof | grep \/media\/KINGSTON |
|||||||
|