ejecting reluctant CDs in Linux

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
Revision as of 22:41, 12 June 2006 by Woozle (talk | contribs) (→‎Overview: correction of "eject" syntax)
Jump to navigation Jump to search

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
  • This command 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