Create an ISO Image from a source CD or DVD under Linux

From Thomas-Krenn-Wiki
Jump to navigation Jump to search

This brief article will describe the creation of a proper ISO image from a CD or DVD.

If an ISO image has been created with the help of the dd (diskdump) command from a CD or DVD then the ISO file created thereby may have an MD5 checksum, which is different than the original ISO file that was used for burning the source CD or DVD. A pair of zero data blocks at the end of the CD or DVD are responsible for this. Such an ISO image can be used without any problems, however testing the MD checksum against the source disk cannot be done (the download servers that provide ISO image for Linux, for example, typically also provide MD5 checksums for testing).

Using the following procedure, exactly the same ISO image that was used for burning the CD or DVD can be read from a CD or DVD:

1. Reading the block size and the volume size:

[root@testserver ~]# isoinfo -d -i /dev/cdrom | grep -i -E 'block size|volume size' 
Logical block size is: 2048
Volume size is: 327867

2. Running dd with the parameters for block size and volume size:

[root@testserver ~]# dd if=/dev/cdrom of=test.iso bs=<block size from above> count=<volume size from above>

Progress indicator:

Since version 8.24 of the GNU Coreutils, to which dd belongs, there is the parameter "status=progress" to get a progress indicator:[1]

[root@testserver ~]# dd if=/dev/cdrom of=test.iso bs=<block size from above> count=<volume size from above> status=progress

Alternative:' If you are using an older version of the GNU Coreutils, the following command can also be used in a second console while reading the ISO image to see the current progress (requires root privileges):

killall -USR1 dd

With the use of watch, this call can also be executed each second:

watch -n 1 killall -USR1 dd

Thereby, dd will display the progress status as follows:

admin@adminpc:~/Downloads/isos$ dd if=/dev/sr0 of=cdimage.iso bs=10M
1+0 records in
0+0 records out
0 bytes (0 B) copied, 10.2447 s, 0.0 kB/s
2+0 records in
1+0 records out
10485760 bytes (10 MB) copied, 16.3769 s, 640 kB/s
3+0 records in
2+0 records out
20971520 bytes (21 MB) copied, 22.3123 s, 940 kB/s
5+0 records in
4+0 records out
41943040 bytes (42 MB) copied, 33.6603 s, 1.2 MB/s

Additional Information

References

  1. GNU Core Utilities - News: coreutils-8.24 released [stable] (savannah.gnu.org): [...] dd accepts a new status=progress level to print data transfer statistics on stderr approximately every second. [...]


Foto Werner Fischer.jpg

Author: Werner Fischer

Werner Fischer, working in the Knowledge Transfer team at Thomas-Krenn, completed his studies of Computer and Media Security at FH Hagenberg in Austria. He is a regular speaker at many conferences like LinuxTag, OSMC, OSDC, LinuxCon, and author for various IT magazines. In his spare time he enjoys playing the piano and training for a good result at the annual Linz marathon relay.


Related articles

Bash Tipps and Tricks
Check TCP Port 80 (http) with telnet
Protecting Web Server Directories with Passwords