Some times CD/DVD drives get stuck and will not eject even if you press the eject button on the front panel. The is especially true when any application that was using the CD drive has gone astray. You can try the following steps to get out of the situation.
Open a terminal and become root.
$ sudo su
Try eject command.
If some application of is using cdrom you will get a message like
umount: /media/cdrom: device is busy
To eject the CD you may have to stop the application. First, let us find out who is using the CD drive.
/media/cdrom: 5929c 6018c 6020c
You can kill all processes accessing using /media/cdrom
# fuser -km /media/cdrom