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.
Practical books for the most technical people on the planet. Newly available books include:
- Agile Product Development by Ted Schmidt
- Improve Business Processes with an Enterprise Job Scheduler by Mike Diehl
- Finding Your Way: Mapping Your Network to Improve Manageability by Bill Childers
- DIY Commerce Site by Reven Lerner
Plus many more.
- Handheld Emulation: Achievement Unlocked!
- Unikernels, Docker, and Why You Should Care
- Building a Multisourced Infrastructure Using OpenVPN
- Download "Linux Management with Red Hat Satellite: Measuring Business Impact and ROI"
- Happy GPL Birthday VLC!
- diff -u: What's New in Kernel Development
- Giving Silos Their Due
- Controversy at the Linux Foundation
- New Products
- Non-Linux FOSS: Snk