How reproducible: Now Steps to Reproduce: 1.du -hs * 2.du -hs dir/* 3. Actual results: $ du -hs * 47M scons-hg-001 1.6M scons-hg-002 27M scons-hg-003 $ du -hs scons-hg-00? 47M scons-hg-001 47M scons-hg-002 27M scons-hg-003 Expected results: $ du -hs * 47M scons-hg-001 47M scons-hg-002 27M scons-hg-003
What does 'correctly' mean in your case? What filesystem are you on? Did you try strace?
(In reply to comment #1) > What does 'correctly' mean in your case? scons-hg-002 size should be 47M in both cases? > What filesystem are you on? $ mount | grep sda8 /dev/sda8 on /mnt/shared type ext3 (rw,noatime,seclabel,errors=continue,barrier=0,data=ordered) > Did you try strace? What's this? It's not installed on my system.
(In reply to comment #2) > $ mount | grep sda8 > /dev/sda8 on /mnt/shared type ext3 > (rw,noatime,seclabel,errors=continue,barrier=0,data=ordered) Is the filesystem consistent? Did you try fsck? > > Did you try strace? > > What's this? It's not installed on my system. strace is a tool that traces system calls, certainly worth to install. You can capture the trace for du as follows: $ strace -o strace.log du ... If you try to repeat both steps 1. and 2. once again, do they produce the exactly same results?
(In reply to comment #3) > (In reply to comment #2) > > $ mount | grep sda8 > > /dev/sda8 on /mnt/shared type ext3 > > (rw,noatime,seclabel,errors=continue,barrier=0,data=ordered) > > Is the filesystem consistent? Did you try fsck? Yes. I rebooted into 'single' mode and did a check on /dev/sda8 with no errors. > > > Did you try strace? > > > > What's this? It's not installed on my system. > > strace is a tool that traces system calls, certainly worth to install. You can > capture the trace for du as follows: > > $ strace -o strace.log du ... I'll attach with the next comment. > If you try to repeat both steps 1. and 2. once again, do they produce the > exactly same results? Well. It produces the same errors until. I've added a couple of other dirs there. Now the results become: $ du -hs * 41M checkout 4.0K getsize.py 30M onlytrunk 27M scons-hg 47M scons-hg-001 47M scons-hg-002 1.3M scons-hg-003 316K scons-hg-003.log 17M scons-hg-nobranches 108K scons-migration-scripts 1.4G scons-mirror Note that now scons-hg-003 is reported wrongly. $ rm -rf checkout $ du -hs * 4.0K getsize.py 30M onlytrunk 27M scons-hg 47M scons-hg-001 47M scons-hg-002 27M scons-hg-003 316K scons-hg-003.log 17M scons-hg-nobranches 108K scons-migration-scripts 1.4G scons-mirror No everything seems ok.I recreate the clone with Mercurial and it's broken again. $ hg clone scons-hg-002 checkout $ du -hs * 60M checkout 4.0K getsize.py 30M onlytrunk 27M scons-hg 47M scons-hg-001 1.6M scons-hg-002 27M scons-hg-003 316K scons-hg-003.log 17M scons-hg-nobranches 108K scons-migration-scripts 1.4G scons-mirror I'll attach strace.log for the last call.
Created attachment 523870 [details] strace.log
Are there any hard-linked files in that directory? $ find -type f -links +1
It appears that yes, there are. With `du -hsl` I get sizes correctly, but that's not intuitive and not needed by default. Especially in this case when directories are specified separately.
This may be a duplicate of bug #561869 then.
I could agree that this one is a duplicate if it wasn't hard to agree with resolution.
Cleanup. *** This bug has been marked as a duplicate of bug 561869 ***