Create a CD/DVD ISO image from disk.

readom dev=/dev/scd0 f=/path/to/image.iso
Many like to use 'dd' for creating CD/DVD iso images. This is bad. Very bad. The reason this is, is 'dd' doesn't have any built-in error checking. So, you don't know if you got all the bits or not. As such, it is not the right tool for the job. Instead, 'reaom' (read optical media) from the wodim package is what you should be using. It has built-in error checking. Similarly, if you want to burn your newly creating ISO, stay away from 'dd', and use: wodim -v -eject /path/to/image.iso

58
By: atoponce
2009-03-08 13:21:23

5 Alternatives + Submit Alt

  • A dear friend of mine asked me how do I copy a DVD to your hard drive? If you want to make a copy of the ISO image that was burned to a CD or DVD, insert that medium into your CD/DVD drive and (assuming /dev/cdrom is associated with your computer?s CD drive) type the following command


    9
    dd if=/dev/cdrom of=whatever.iso
    0disse0 · 2009-09-05 09:19:41 3
  • An easy method to generate ISOs from CD/DVD media.


    6
    dd if=/dev/cdrom of=~/cdrom_image.iso
    o0110o · 2012-07-10 06:03:25 6

  • 1
    cp /dev/cdrom file.iso
    alexku · 2011-06-02 10:07:59 0

  • 0
    cat /dev/cdrom > ~/img.iso
    fhh · 2013-09-17 19:08:54 0
  • This example is taken from Cygwin running on Win7Ent-64. Device names will vary by platform. Both commands resulted in identical files per the output of md5sum, and ran in the same time down to the second (2m45s), less than 100ms apart. I timed the commands with 'time', which added before 'dd' or 'readom' gives execution times after the command completes. See 'man time' for more info...it can be found on any Unix or Linux newer than 1973. Yeah, that means everywhere. readom is supposed to guarantee good reads, and does support flags for bypassing bad blocks where dd will either fail or hang. readom's verbosity gave more interesting output than dd. On Cygwin, my attempt with 'readom' from the first answer actually ended up reading my hard drive. Both attempts got to 5GB before I killed them, seeing as that is past any CD or standard DVD. dd: 'bs=1M' says "read 1MB into RAM from source, then write that 1MB to output. I also tested 10MB, which shaved the time down to 2m42s. 'if=/dev/scd0' selects Cygwin's representation of the first CD-ROM drive. 'of=./filename.iso' simply means "create filename.iso in the current directory." readom: '-v' says "be a little noisy (verbose)." The man page implies more verbosity with more 'v's, e.g. -vvv. dev='D:' in Cygwin explicitly specifies the D-drive. I tried other entries, like '/dev/scd0' and '2,0', but both read from my hard drive instead of the CD-ROM. I imagine my LUN-foo (2,0) was off for my system, but on Cygwin 'D:' sort of "cut to the chase" and did the job. f='./filename.iso' specifies the output file. speed=2 simply sets the speed at which the CD is read. I also tried 4, which ran the exact same 2m45s. retries=8 simply means try reading a block up to 8 times before giving up. This is useful for damaged media (scratches, glue lines, etc.), allowing you to automatically "get everything that can be copied" so you at least have most of the data. Show Sample Output


    -1
    dd bs=1M if=/dev/scd0 of=./filename.iso OR readom -v dev='D:' f='./filename.iso' speed=2 retries=8
    scotharkins · 2013-10-23 15:53:27 0

What Others Think

what? no mkisofs?
linuxrawkstar · 634 weeks and 4 days ago
you should checksum your images anyway, will not `dd` be marginally faster? dd bs=2048 if=/dev/cdrom | tee image.iso | md5sum | tee image.iso.md5
asmoore82 · 634 weeks and 4 days ago
Sure, you can checksum, and if it doesn't match up, you get to do it again? Why not fix the errors on the fly? And no, dd won't be marginally faster. It will move at the same pace as readom- the pace of your hardware.
atoponce · 634 weeks and 4 days ago
Great command! Thanks.
bwoodacre · 634 weeks and 2 days ago
Thanks this it the right command
megerdin · 631 weeks and 6 days ago
dd ? not. esspesialy if you have errors which readom reread for example : Errno: 5 (Input/output error), read_g1 scsi sendcmd: no error0 cnt: 128 CDB: 28 00 00 2A 6F 80 00 00 80 00 status: 0x2 (CHECK CONDITION) Sense Bytes: 72 0B 00 00 00 00 00 0E 09 0C 00 00 00 02 00 00 Sense Key: 0x0 No Additional Sense, Segment 11 Sense Code: 0x00 Qual 0x02 (end-of-partition/medium detected) Fru 0x0 Sense flags: Blk 0 (not valid) cmd finished after 40.649s timeout 40s readom: Input/output error. Cannot read source disk readom: Retrying from sector 2781056....
PasQty · 480 weeks and 4 days ago
A USB device that is used for storage purposes used for different purposes as well. The blog is throwing light well on the different out puts of the two different programs and students can check best writing apps from www.mobileappdaily.com/best-writing-apps and get excellent academic ideas. Such technical blogs are dealing with these kind of systems and functions to let us aware of them.
MaryKlein · 58 weeks and 6 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: