On Mon, Oct 21, 2013 at 04:21:35PM +0200, Dominique Leuenberger a.k.a. Dimstar wrote:
the point of dd is to read 'blocks' in chunks (size specified by bs=) until the 'END of input is reached'.
/dev/random is not an 'endless' buffer and as such, once the end is reached, dd stops copying. count= means a MAX amount of blocks to be copied from input; and as many blocks as there are with bs= bytes.
This is actually not what happens. You don't get an EOF when reading from /dev/random - but neither you get as many bytes as you requested: mike@unicorn:~> strace -o logg dd if=/dev/random of=/dev/null bs=1K count=16 dd: warning: partial read (128 bytes); suggest iflag=fullblock 0+16 records in 0+16 records out 282 bytes (282 B) copied, 26.4863 s, 0.0 kB/s read(0, "\0\322\214\201\304\3321\10\344/\270\260?\30}\367>\3UX\270\243G\336\303\323\374\270\16\7\375\277"..., 1024) = 128 read(0, "\223\31T\204a\307Qr0\356Z\370\356\17\210\223\7$S\326\371\365|\246\4\213i\37\332)|\330"..., 1024) = 42 read(0, "^H\26u\377\234\213S", 1024) = 8 read(0, "\34\26\373\377\275\5\2Q", 1024) = 8 read(0, "E\334\4Y\277\364\351\25", 1024) = 8 read(0, "\27c.0\202\274D\331", 1024) = 8 read(0, "+\3U\214\246=\275\21", 1024) = 8 read(0, "\354p\253\267f\344\325\336", 1024) = 8 read(0, "D\302\302\305!\26z{", 1024) = 8 read(0, "\t\370\1\331\340