Subject: Strange output from 'du'
To: None <netbsd-help@NetBSD.org>
From: David Lord <david@lordynet.org>
List: netbsd-help
Date: 08/12/2006 20:57:52
Hi

I'm just starting replacing FreeBSD 5.3 on couple of servers with
NetBSD 3.0.1 and had tarred up all the FreeBSD directories over nfs
onto another NetBSD system.

After restoring the main data directories (21G and 11G) onto the new
system I did a quick check with 'du' that all main directories were 
at least same size but found a few discrepancies so checked 
individual files and had some strange results.

For apparently same file I get three different sizes from du. Is 
this a bug or limitation with du, or am I missing something?

# cp /mnt/p4x2400c.06080201/usr/home/dlord/win98/prfile/PrFile.exe 
/tmp/pf0

# du -h /home/dlord/home_dlord_fbsd/win98/prfile/PrFile.exe
126K    /home/dlord/home_dlord_fbsd/win98/prfile/PrFile.exe

# du -h /mnt/p4x2400c.06080201/usr/home/dlord/win98/prfile/PrFile.exe 
/tmp/pf0
142K    /mnt/p4x2400c.06080201/usr/home/dlord/win98/prfile/PrFile.exe
152K    /tmp/pf0

# ls -l /home/dlord/home_dlord_fbsd/win98/prfile/PrFile.exe
-rwxr--r--  1 clamav  clamav  145008 Oct 22  2000 
/home/dlord/home_dlord_fbsd/win98/prfile/PrFile.exe

# ls -l /mnt/p4x2400c.06080201/usr/home/dlord/win98/prfile/PrFile.exe 
/tmp/pf0
-rwxr--r--  1 clamav  clamav  145008 Oct 22  2000 
/mnt/p4x2400c.06080201/usr/home/dlord/win98/prfile/PrFile.exe
-rwxr--r--  1 root    wheel   145008 Aug 12 19:57 /tmp/pf0

# md5 /home/dlord/home_dlord_fbsd/win98/prfile/PrFile.exe
MD5 (/home/dlord/home_dlord_fbsd/win98/prfile/PrFile.exe)
 = e8074493c77dce2dea4d765b2b842cce

# md5 /mnt/p4x2400c.06080201/usr/home/dlord/win98/prfile/PrFile.exe 
/tmp/pf0
MD5 (/mnt/p4x2400c.06080201/usr/home/dlord/win98/prfile/PrFile.exe)
 = e8074493c77dce2dea4d765b2b842cce
MD5 (/tmp/pf0)
 = e8074493c77dce2dea4d765b2b842cce