How to copy a cd/dvd on the hard disk in a ISO file

Firstly you have to mount the cd/dvd.

mkisofs -r -R -J -l -L -o isofromcd.iso /mnt/hdc/

Where hdc is your hard drive. It may be different for you. Check that out!