du -s show a wrong directory size

Bug #1004319 reported by Nico Giefing
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
coreutils (Ubuntu)
New
Undecided
Unassigned

Bug Description

root@machine1:/data/directory# du -s *
7116400 backup_dir1
root@machine1:/data/directory# find -type f|xargs ls -al|cut -b 23-34
 19327352832
         424
        1983
          30
 21474836480
         421
        2211
          30
 21474836480
         422
        2110
          30
          30
  8589934592
         423
        2001
root@machine1:/data/directory#

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: coreutils 8.13-3ubuntu3
ProcVersionSignature: Ubuntu 3.2.0-24.38-generic 3.2.16
Uname: Linux 3.2.0-24-generic x86_64
ApportVersion: 2.0.1-0ubuntu7
Architecture: amd64
Date: Fri May 25 07:19:41 2012
InstallationMedia: Ubuntu-Server 12.04 LTS "Precise Pangolin" - Release amd64 (20120424.1)
ProcEnviron:
 SHELL=/bin/bash
 TERM=xterm
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 LANGUAGE=en_US:en
SourcePackage: coreutils
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Nico Giefing (nico-giefing) wrote :
Revision history for this message
A. Eibach (andi3) wrote :

21474836480 = overflow.

This is 500,000,000 in hexadecimal. (500 million)

BTW, your output is extremely specific on your settings in date and such. It depends on whether I want to display the month or not.
There is a -ls option in find; no need to pipe this through xargs.

So try

$ find . -type f -ls | awk '{print $7}'

This should give a much smaller footprint on your CPU load.
Maybe this "fixes" the "bug" you reported as well,

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.