Difference between revisions of "ejecting reluctant CDs in Linux"
Jump to navigation
Jump to search
m (→Overview: correction of "eject" syntax) |
(→Overview: note on where to find lsof) |
||
Line 8: | Line 8: | ||
{{linuxcmd|umount}} -f <u>/dev/name</u> | {{linuxcmd|umount}} -f <u>/dev/name</u> | ||
− | * | + | * {{linuxcmd|lsof}} (might be in /usr/sbin) lists processes which have files open on the device, so you can {{linuxcmd|kill}} them: |
{{linuxcmd|lsof}} <u>/dev/name</u> | {{linuxcmd|lsof}} <u>/dev/name</u> | ||
Revision as of 16:54, 14 July 2006
computing: software: Linux: ejecting reluctant CDs in Linux
Overview
Linux tends to lock CD and DVD drives, which prevents the drive from ejecting their media even if you press the drive's "eject" button.
Some useful commands for this situation – execute these as root or using sudo, where /dev/name is the name of the device name (this can be found using KDiskFree, but there are probably better ways):
- This command forces the device to umount, even if busy (but it may not work even so):
umount -f /dev/name
- lsof (might be in /usr/sbin) lists processes which have files open on the device, so you can kill them:
lsof /dev/name
- This command kills processes that don't want to die (where pid is the process ID number):
kill -9 pid
- And finally, if the drive seems completely unmounted but the door still won't open, try:
eject /dev/name