List Open Files
If you try to unmount a partition and get a message like this:
# umount /media/usbdisk/
umount: /media/usbdisk: device is busy
use the lsof command to find out what programs are using what files:
# lsof /media/usbdisk/
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
bash 6925 root cwd DIR 8,17 4096 1 /media/usbdisk/
xmms 6979 root cwd DIR 8,17 4096 1 /media/usbdisk/
This shows that the programs bash and xmms are using the device. For an even clearer picture, use the device name rather than the mountpoint:
# lsof /dev/sdb1
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
bash 6925 root cwd DIR 8,17 4096 1 /media/usbdisk
xmms 6979 root cwd DIR 8,17 4096 1 /media/usbdisk
xmms 6979 root 8r REG 8,17 2713101 377 /media/usbdisk/a.mp3
You either can wait until those processes exit or terminate them manually.
Popular Posts
-
du stands for disk usage. This simple linux command provides a summary of harddisk or storage space disk usage. It has many parameter argume...
-
When developing applications, it is common to interact with various tools that require a network connection to function correctly. However, ...
-
HOW TO INSTALL GOOGLE CHROME OS : Do you want to install Google's very own operating system called Chrome OS? If yes, then just follow t...
-
Linux kernel has in recent times seen numerous advances. And the latest versions of the Linux kernel namely 2.6.28 and 2.6.29 have some fabu...
-
It is good to know that it's possible to play those classicNintendo NES games on any Android device with physical keyboard (Motorola Bac...
-
The MBR is a 512 byte segment on the very first sector of your hard drive composed of three parts: 1) the boot code which is 446 bytes long...
-
MooLux is available as zip format. Extract the file to your USB Disk, run a command, boot your computer with first boot to USB Disk. You mi...
-
The KDE vs. GNOME debate — which we sincerely hope we aren't sparking anew — is one of the great legacies of the Linux world. Everyone s...
-
Shell scripting is a way to write programs that run on Unix/Linux systems. It's a powerful skill to have since it allows users to automa...
-
Ever wanted to access a service behind a firewall that has port 22 open for ssh connections? This is a common setup known as using a jump-bo...