fuser can show which program is currently using a file on disk, mount point, or even network port, and give details of the program process. If the device that cannot be unloaded is/media/matlab, run the following command:
$ sudo fuser-m-v/media/matlab/
user process number permission command
/media/matlab/: galeki 335 . C.. Gqview
$ sudo umount/media/matlab
#-m parameter shows all processes using the specified file system, followed by the mount point, or the dev device
#-v parameter gives detailed output, you can see that the original is Gqview This program is still hogging the mobile device # Fuser also gave the process number of the
program, know the process number, you can dispose of the program as a matter of
---------------------------------------- ------------------------------
# In addition you can also add a-K parameter:
$ sudo fuser-m-k/media/matlab/ # This trick automatically occupies the/media/ matlab/program kills
$ sudo umount/media/matlab
# If you're not sure if you're going to kill all the device-hogging programs, you can also add a-I argument so that every program that kills one will ask:
$ sudo fuser-m-v-i-k/media/matlab/
user process number permission command
/media/matlab/: galeki 371 .. C.. Gqview
kills process 371? (y/n)
$ sudo umount/media/matlab
Very smooth solution of the "Device is busy" problem ~