Assuming that your CD or DVD is located in media/cdrom0, here are two lines of code that will enable you to mount or unmount a disc.
To mount a CD or DVD, simply open your terminal and type
sudo mount /media/cdrom0/ -o unhide
. Once your CD is mounted, you can access your data through your directory.
To unmount or eject the disc, open your terminal and enter
sudo umount /media/cdrom0/ -l