Check & close the applications which are using any mounted partition or folder
If you are using a separate partition for your applications, you need to mount that partition to a folder. Then only you can store & run the application. But if you want to umount that partition again, first you need to close all the applications which are using that mounted partition or folder.
To check all the application running from that partition or folder, just issue a simple command:
fuser -mv /dev/sda1
fuser -mv /usr/local/bin
The above commands can show the output as follows:
USER PID ACCESS COMMAND
/dev/sda1: root 2467 .rce. mingetty
root 2476 .rce. mingetty
root 2502 .rc.. kauditd
root 2506 .rce. sshd
root 2509 .rce. bash
You can also use the following command:
fuser -mv /dev/sda1 > /tmp/sda1.pids
It will store the PIDs of all application running from ‘/dev/sda1’ partition.
Now you can simply issue the ‘kill’ command to close all the applications forcefully.
kill -9 `cat /tmp/sda1.pids`
It will free the partition /dev/sda1 to umount.
Don’t use this method on active partitions, it can cause the OS failure. But after reboot it may be recovered.