NOTE: Although I have actually mounted the .iso image and md5summed that instead of an actual cd, the principal is the same, except you would use "/dev/cdrom" instead of "/dev/loop0".
- clive@dogmatix > pwd
- /home/clive/temp
- clive@dogmatix > mkdir testmount
- clive@dogmatix > ll -h My_cd_09.iso
- -r--r----- 1 clive clive 644M 2012-09-11 13:16 My_cd_09.iso
- clive@dogmatix > sudo mount -o loop My_cd_09.iso /home/clive/temp/testmount/
- clive@dogmatix > md5sum My_cd_09.iso
- cf8b114922fc3fcb0d356825e89b5c49 My_cd_09.iso
- clive@dogmatix > dd if=/dev/loop0 2>/dev/null | md5sum
- cf8b114922fc3fcb0d356825e89b5c49 -
- clive@dogmatix > isoinfo -d -i /dev/loop0 ### Unwanted lines removed below. ###
- CD-ROM is in ISO 9660 format
- System id: LINUX
- Volume id: My cd 09
- Application id: GENISOIMAGE ISO 9660/HFS FILESYSTEM CREATOR
- Logical block size is: 2048
- Volume size is: 329453
- Joliet with UCS level 3 found
- Rock Ridge signatures version 1 found
- clive@dogmatix > dd if=/dev/loop0 bs=2048 count=329453 conv=notrunc,noerror | md5sum
- 329453+0 records in
- 329453+0 records out
- 674719744 bytes (675 MB) copied, 1.57553 s, 428 MB/s
- cf8b114922fc3fcb0d356825e89b5c49 -
- clive@dogmatix > dd if=/dev/loop0 bs=2048 count=329453 conv=notrunc,noerror 2>/dev/null | md5sum
- cf8b114922fc3fcb0d356825e89b5c49 -
- clive@dogmatix > echo "scale=2; (2048 * 329453) / 1024 / 1024" | bc
- 643.46
You can also see that a straight "dd" command (Line 9) gets the same result as using "dd" with specifying the block size and the number of blocks (Lines 11 - 26).
Lines 25 and 26 are merely there to strip out the unwanted information that was shown in Lines 20 - 24 (It could be redirected to a file instead of /dev/null).
Lines 27 and 28 are just there to show the size of the data on the cd/dvd, obviously there is extra information contained on the cd/dvd that holds the table of contents, data type etc. that makes up the .34 Mb of data difference between the size of the .iso and the cd itself. (Lines 5 and 28)
No comments:
Post a Comment