If you use Linux and you use CD or DVD media, you are probably familiar with this error message: Unable to unmount device. Device still in use.. It occurs, if you want to unmount or eject a CD or DVD and some application is still using it. This could be an open bash promt or a Nautilus window. Or a video player. But what can you do, if you checked every application that is currently running and you’re still unable to eject the CD? Terminal powers to the rescue! Open a new terminal window and type:
sudo lsof | grep cdrom
The output should be similar to this:
esd 12957 nachtarbeiter 25r REG 22,0 324153344 1418 /media/cdrom0/badewanne.avi
In this case you can see, that a program called esd (it is a sound deamon) still uses a file called badewanne.avi on the CD medium. You need to kill that program before you can eject your CD. All you need is the number shown after the programs name. It is the process id of the programm.
kill 12957
That’s all folks.
Shameless plug: If this post was useful to you, please consider buying yourself something from one of my Amazon stores: US store, UK store, FR store, DE store, CA store. If you're not into Amazon, why not donate something to GNOME, Mozilla or Wikipedia? Thank you!



highly interesting! I will remember this …just in case.
highly interesting! I will remember this …just in case. thx!