Anyone know of a random data generator?
Dan Jenkins
dan at rastech.com
Thu Jul 29 15:08:01 EDT 2004
Dan Coutu wrote:
> For some tests I'm running it would be really useful to have a random
> (or even semi-random) data source that can be used for making really
> big files of arbitrary size. It turns out to be trickier than I had
> expected. So for example I thought I'd be able to write data to a
> tape all the way to the end like this:
>
> cat /dev/random | tar cf /dev/st1 -
>
> Which I expected to use the endless stream of random data generated
> by /dev/random as input to the tar command which would write to tape
> until it errored out at the end of the tape.
>
> The reality is that it did nothing at all. Not one single byte of
> data.
>
> So, any other bright ideas?
Use /dev/urandom instead. Make sure you are generating adequate entropy
too. That's why /dev/random blocked on you, not enough entropy.
From a Linux Gazette article:
> That's actually the difference between "random" and "urandom".
> "random" will block until it has more 'randomness' to give you, while
> "urandom" will spit up the the entire entropy pool, then give you
> either pseudorandomness or a repeat (I'm not sure which, actually),
> but will not block.
--
Dan Jenkins (dan at rastech.com)
Rastech Inc., Bedford, NH, USA --- 1-603-624-7272
*** Technical Support for over a Quarter Century
More information about the gnhlug-discuss
mailing list