Today I noticed something very strange on a few Linux machines.
I needed a 10 Mb file to do some bandwidth tests, I would just put it on a web server and download it often. I used dd to create a file that I thought was 10Mb and checked it with du -h:
# dd if=/dev/urandom of=10megfile.dat bs=1024 count=10240 # ls -l 10megfile.dat -rw-r--r-- 1 root root 10485760 nov 4 16:38 10megfile.dat # du -h 10megfile.dat 11M 10megfile.dat
So I thought I am going mad since surely du cannot be wrong, I checked with the Google Calculator and it agrees, 10 485 760 bytes does make 10 Mb.
I then checked the same on FreeBSD and it finds it as 10Mb, RedHat 6.2 agrees it is 10Mb but RedHat 7.2 and a number of Mandrake machines thinks it is 11Mb.
I guess I need to have a chat with bug-fileutils@gnu.org