If you cannot eject the CD or DVD from the drive:
Confirm whether the drive path is the current directory (pwd) in a UNIX terminal window. If it is, change (cd) to another directory.