Questions about file size and dd
According to DD, I'm making at least 5mB files, right? But according to ls and du, they're a tenth of a mB or so short. Anyone know why?
bash-3.2$ dd if=/dev/random of=foo.bsKB-count.5000 bs=KB count=5000
5000+0 records in
5000+0 records out
5000000 bytes (5.0 MB) copied, 1.202 s, 4.2 MB/s
bash-3.2$ dd if=/dev/random of=foo.bsKB-count.5120 bs=KB count=5120
5120+0 records in
5120+0 records out
5120000 bytes (5.1 MB) copied, 1.304 s, 3.9 MB/s
bash-3.2$ dd if=/dev/random of=foo.bsMB-count.5 bs=MB count=5
5+0 records in
5+0 records out
5000000 bytes (5.0 MB) copied, 0.97 s, 5.2 MB/s
bash-3.2$ ls -1sh foo*
bash-3.2$ du -h foo*
1 megabyte = 1024 kilobytes. You are calculating as if 1 megabyte = 1000 kilobytes.
Sure, that explains why the first one (5000kB) is less than 5mB, but what of the other two?
Ah. Seems I missed the section of man dd that says:
|All times are GMT -5. The time now is 05:09 AM.|