Re: dd if=/dev/random of=data.bin bs=512 count=1

From: Bernd Eckenfels
Date: Sun May 17 2009 - 13:17:01 EST


In article <19ac3f7a0905170822q28255239nea01b56d52e3ddf8@xxxxxxxxxxxxxx> you wrote:
> Issuing this command, I expected to get a file 4096 bytes in size.

one time 512 is 512 not 4096.

> if I have a count=10 it hangs forever (several hours).

It depends on your harware and usage type (mouse atached?) how much entropy
is generated and filled into the pool. If you drain it, it will hang for
/dev/random and generate PRNG data with /dev/urandom.

You should think carefully about sucking too many random bytes from /dev/random.

> $ dd if=/dev/random of=data.bin bs=512 count=1
> 0+1 records in
> 0+1 records out
> 8 bytes (8 B) copied, 4.47366 s, 0.0 kB/s

I am not sure why you only get 8bytes here, but I would suggest to use "bs=1
count=256" anyway.

Gruss
Bernd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/