Friday, February 10, 2006

How to make an ISO

To make an ISO from CD/DVD.
Place the media in the drive and do not mount it. If it automounts, unmount it.

commands are as follows:

$ dd if=/dev/dvd of=dvd.iso # for dvd
$ dd if=/dev/cdrom of=cd.iso # for cdrom
$ dd if=/dev/scd0 of=cd.iso # if cdrom is scsi

To make an ISO from files on hard drive.
Create a directory which holds the files.
Then use the mkisofs command.

$ mkisofs -o /tmp/cd.iso /tmp/directory/

This results in a file called cd.iso in folder /tmp which contains all the files and directories in /tmp/directory/.

For more info, see the man pages for mkisofs, losetup, and dd, or see the CD-Writing-HOWTO at

If one wants to create an ISO images of a CD using Windows, Cygwin has a dd command that will work. Since dd is not specific to CDs, it will also create disk images of floppies, hard drives, zip drives, etc.




Motoma said...

Helpful, however it would be nice if you documented the process with Cygwin as well, as you cannot access drives in the same manner with Windows.

kirel said...

My thoughts also. I tried 'dd if=/cygdrive/e of=image.iso' and get the message that /cygdrive/e is a directory. (note: E: drive is my 1st CDROM drive in Windows)

Any thoughts to overcome this would be appreciated.

Anonymous said...

If the source is a folder, you need mkisofs. 'man mkisofs'.

Anonymous said...

no, anonymous, mkisofs is not relevant here. We are not trying to make an iso filesystem from files and directories, but rather from a cdrom. The error message is encountered because /cygdrive/e is seen by dd as a directory instead of a device.

The missing steps for getting this to succeed are documented here on wikipedia. Basically, you need to mount the device first. Note also that you will get an "Invalid argument" error if you do not specify a blocksize (bs=) parameter.

Another approach is documented here using a standalone native win32 version of dd instead of the cygwin version. In that case, the command

dd if=\\?\Device\CdRom0 of=c:\temp\disc1.iso bs=1M"

will save an iso image of a CD.

niroadmtc said...

Thanks in Advance..
I was trying..for make a autorun cd for multiplatform..

i tried this code.and it works..
i already had installed cygwin..

mkisofs \
-abstract info/abstract.txt \
-A " E learning " \
-biblio info/bibloography.ris \
-copyright info/copyright.txt \
-iso-level 3 \
-J \
-log-file ../mkisofs.log \
-o ../elarning-2008-08-25.iso \
-p "K W N S Perera,, +1 123 123 1234" \
-publisher "UCSC ADMTC " \
-r \
-sysid ELEARNING-1 \
-T \
-V Elearning \
-hfs \
-map ../macfiles.txt \
-auto index.html \

thnks again..

Eden said...

I too had this problem. I wanted to make an ISO from a bootable CD, so it was particularly important that the iso was a pure disc image and not just a copy of the files. I was using windows at the time so I tried the dd for windows solution posted above.

The command:
dd if=\\?\Device\CdRom0 of=c:\temp\disc1.iso bs=1M

does not work for me. I had to use
dd --list
to get the real volume name of my cdrom drive and then fed that volume name into the dd command:

dd.exe if=\\.\Volume{aaa01aa11-aa1a-11aa-111a-111a1111111a} of=disc1.iso bs=1M

This worked great, dumped a 4-gig ISO of my bootable DVD and I can successfully boot to this ISO when I burn it back to a DVD or mount it locally and access it via a virtual machine.

Vijay Kumar said...

Thanks Eden.

Great information to have this here.

Thanks again.


BobbyO said...

on Windows 7 64bit make sure Windows Explorer is closed when running dd.