Create a CD/DVD ISO image from disk.

dd bs=1M if=/dev/scd0 of=./filename.iso OR readom -v dev='D:' f='./filename.iso' speed=2 retries=8
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 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.
Sample Output
sharkins@L7EIS-TEL023 /cygdrive/c/Zip/HP/USB HD 720p Business Webcam
$ time readom -v dev='D:' f='./HP-HD-2200_ViaReadom-Take3.iso' speed=2 retries=8
scsidev: 'D:'
devname: 'D'
scsibus: -1 target: -1 lun: -1
Read  speed:  1764 kB/s (CD  10x, DVD  1x).
Write speed:     0 kB/s (CD   0x, DVD  0x).
Capacity: 59379 Blocks = 118758 kBytes = 115 MBytes = 121 prMB
Sectorsize: 2048 Bytes
Copy from SCSI (2,0,0) disk to file './HP-HD-2200_ViaReadom-Take3.iso'
end:     59379
addr:    59379 cnt: 14
Time total: 165.562sec
Read 118758.00 kB at 717.3 kB/sec.

real    2m45.742s
user    0m0.062s
sys     0m0.420s

sharkins@L7EIS-TEL023 /cygdrive/c/Zip/HP/USB HD 720p Business Webcam
$ time dd bs=1M if=/dev/scd0 of=./HP-HD-2200_Via_dd.iso
115+1 records in
115+1 records out
121608192 bytes (122 MB) copied, 165.575 s, 734 kB/s

real    2m45.665s
user    0m0.015s
sys     0m0.062s

sharkins@L7EIS-TEL023 /cygdrive/c/Zip/HP/USB HD 720p Business Webcam
$ md5sum *
f42303c3b030a0e528c3d28bb80683a9 *HP-HD-2200_Via_dd.iso
f42303c3b030a0e528c3d28bb80683a9 *HP-HD-2200_ViaReadom-Take3.iso

2013-10-23 15:53:27

5 Alternatives + Submit Alt

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? 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.


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: