On 23/02/14 21:00, Reco wrote:
>  Hi.
> 
> On Sun, 23 Feb 2014 11:45:26 +1100
> David <bouncingc...@gmail.com> wrote:
> 
>> whereas if you know that you do actually want the output file, it will
>> be quicker to
>> read it once and then checksum the file like this:
>>   # dd if=/dev/cdrom bs=2048 count=23150592 conv=notrunc,noerror > cd.iso
>>   # md5sum cd.iso
> 
> You can read the device once, write the result to the file AND calculate the
> checksum at the same time:
> 
> dd if=/dev/cdrom bs=2048 count=23150592 conv=notrunc,noerror | tee cd.iso | 
> md5sum

1++

You 'could' then compare that md5sum to the one on the cdimage site - if
it's a stock CD.
If it's not, and I don't misunderstand the "noerror" parameter for dd,
then it 'might' be a good idea to compare the md5sum of the CD *before*
copying it. e.g.:-
$ md5sum /dev/sr0;dd if=/dev/cdrom bs=2048 count=23150592
conv=notrunc,noerror | tee cd.iso | md5sum
The comparison of md5sums, either of the original CD and the copy, or
the cdimage site md5sum and the copy could easily be automated.

NOTE: the documentation suggests the cd copy command is run as root -
that's un-necessary, and like the running of any command as root that
doesn't actually need to be run as root - unwise.

> 
> Reco
> 
> 

Kind regards


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/5309ca27.6000...@gmail.com

Reply via email to