I admit to lazyness: Can I "fork" a stream of data (dual use)?
This weekend I used Steve Litt's rawread-scheme to duplicate SuSE 8.2 :D.
I also followed his advice, and compared the md5sums of source and target CD-ROMs. That means reading five disks three times (once getting the data, then getting the original md5sum, then after burning the new CD). Well, to do that 15 times to a CD ... :rolleyes: So here is my question(s): When I copy the source-CD with something like Code:
dd if=/dev/cdrom of=/my/temporary/iso bs=n cont=m I was wondering, whether there is something like "||" for two parallel / diverging pipes or any possibility to influence stdout (1>) to do that? Actually I'd imagine that md5sum could also work in-between if= and of= of the dd-statement, but that would bust dd ... so I need probably a "cloned" data-stream for md5sum but how do I get that? P.S.: While I'm at it, Is there a utility to compare a set (source and target) of md5sums? |
;) After dumping the ISO image, just enter the following command: md5sum /my/temporary/iso Making the md5sum of the ISO image from harddisk is much faster than from CD.
:study: the magic command to use the standard output of a program twice is tee . To send output of dd to stdout, omit the of= option. from man md5sum md5sum [OPTION] --check [FILE] DESCRIPTION Print or check MD5 (128-bit) checksums. With no FILE, or when FILE is -, read standard input. -c, --check check MD5 sums against given list so: create a file with file names and md5sums (i.e. the "given list") and issue the md5sum program with the options above. Apparently, you like parallel processes. try the following: dd if=/dev/cdrom bs=n cont=m | tee /my/temporary/iso | md5sum |
Quote:
And it still means reading data twice. Moreover, it doesn't discover errors during transfer from the CD to the hard-disk :(. Quote:
(read that as bold+italic+underlined+blinking+magenta on turquoise Background). That's what I was looking for. And it works, yippeeee. I was simply stumped, I didn't know where to look. Thanks a load. This forum is fun :) :D :). Quote:
Quote:
Quote:
|
Quote:
Quote:
Code:
asfgjh276bd7bgbds67 - . /file/to/check/with/md5sum Code:
md5sum -c /given/list/file |
perhaps the tee command is what you're looking for.
I guess you can use this in a pipe... dd if=/dev/cdrom | tee some.iso | md5sum - ? but I'm not sure how efficient this really is. dd seams to write large blocks at once, and perhaps tee doesn't. Use the "time" command to find out what is faster. md5sum -c is used the check a file, it requires an .md5 file as input. This file contains some master list of all files, and their md5 sums. |
Yes, it was tee, and it is definitely faster (subjectively at least). Remember, that dd is reading by DMA slowly from a CD-ROM and writing by DMA to the disk, while md5sum hashing is done by the CPU. I'd guess, in this case there is little competition for resources.
Quote:
|
the format of the md5 file is simply a list of md5 hashes, and file names. Other text may be included, and doesn't seam to bother "md5sum"
Code:
112f9e2ae9cfbaebfb2137fa2292ab54 ./ChangeLog.txt Code:
diederik@hal9000 zipslack $ md5sum -c CHECKSUMS.md5 |
Well, I got it working with the results as indicated by yapp. The reason for my problems was too much reading on my part ;). I used
Code:
asfgjh276bd7bgbds67 - . /file/to/check/with/md5sum Code:
info md5sum Code:
<blank><minus><blank><dot><blank><file name> The next problem was the minus sign after the md5sum-result. That was part of the output of md5sum to the screen (stdout). When redirected to a file, the output was <md5sum-result><blank><filename>, which I could use directly as input for the next run of md5sum. So, thanks a lot, stonux and yapp, for a most instructive thread. :) |
All times are GMT -5. The time now is 09:45 AM. |