SVisor a écrit :

dd if=/dev/zero of=file1 bs=1k count=1024

I wanted a file of garbage, not zeroes. So I tried: dd if=/dev/random of=file bs=1k count=1024


If you don't need encryption-level random numbers (just noise) you can use urandom. It will also be much faster because it will continue to send data even when his entropy pool will be exhausted.


dd if=/dev/urandom of=file bs=1k count=1024

But to my suprise I got only a ~4k file. I know that dev/random may run out of values. But should dd not wait until there are enought of data?

That's exactly what it is supposed to do. Perhaps you tought /dev/random could generate random numbers much faster. So when it's entropy pool was exhausted after 4KB, you tought it stopped working.


By default, there is only a reserve of 4k of entropy in /dev/random. Once exhausted, the others bits are *much* slower to get. I mean, in the order of 1,000,000 times slower than urandom unless you have a special device to generate random numbers in hardware.

  You can see how much unused entropy you have with that:

cat /proc/sys/kernel/random/entropy_avail


Simon Valiquette http://gulus.USherbrooke.ca http://www.gulus.org

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

Reply via email to