Howto create an ISO Image in Linux

Credits: This little HOWTO was taken from http://secpriv.com/viewarticle.php?id=7

Not really related to privacy or security, but I sometimes forget this command, and need to look it up. This way, I'll know exactly where to find it:

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

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 your hard drive, create a directory which holds the files you want. 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/.

Update: 08/29/2006

(From #nblug on irc.freenode.net)
[09:07] Fratm : Got a quick question, if anyone know the answer, that would be great =).. Currently I can make an ISO image with this command "mkisofs -o /tmp/cd.iso /tmp/directory/"... But this truncates long files names to the old dos 8.3 format... How can I mage an ISO image that is more inline with modern long filenames?
[09:10] freiheit : There's multiple ways to do long filenames.
[09:11] freiheit : Joliet is windows-ish.... -J. Rock Ridge is more unixy, -R or -r (usually you want -r). -T makes the old TRANS.TBL files for other software...
[09:12] freiheit : I'd suggest both -J and -r. -T is old-fashioned.
[09:16] Fratm : Cool, I think I would mainly want the Joliet format, since I would want best compatibility across both linux and windoze platforms..
[09:24] freiheit : use both
[09:24] freiheit : -Jr

Update: 02/27/2007

This is what I have been using and works very well.

mkisofs -J -r -o /tmp/isoname.iso /directory/you/want/to/image

-Fratm

Powered by Drupal - Design by artinet