Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 04 Sep 2015 12:42:53 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 202891] du, df, ls etc. report different storage sizes
Message-ID:  <bug-202891-8@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=202891

            Bug ID: 202891
           Summary: du, df, ls etc. report different storage sizes
           Product: Base System
           Version: 10.2-RELEASE
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: bin
          Assignee: freebsd-bugs@FreeBSD.org
          Reporter: tonkyhonk@mailinator.com

With the risk of this just being sparse files tricking me... du(1), df(1),
ls(1) and various other applications report different storage footprints:

root@skrot:/var/db # du -sh mongodb/
1.7G    mongodb/

root@skrot:/var/db # du -sh mongodb/*
 47M    mongodb/bongo.0
 93M    mongodb/bongo.1
237M    mongodb/bongo.2
466M    mongodb/bongo.3
872M    mongodb/bongo.4
 32M    mongodb/bongo.5
 16M    mongodb/bongo.ns
 20K    mongodb/journal
160K    mongodb/local.0
 16M    mongodb/local.ns
4.0K    mongodb/mongod.lock
 44K    mongodb/mongod.log

root@skrot:/var/db # df -h
Filesystem    Size    Used   Avail Capacity  Mounted on
/dev/ada0a    143G    3.1G    129G     2%    /
devfs         1.0K    1.0K      0B   100%    /dev

root@skrot:/var/db # ls -lh mongodb/
total 1821940
-rw-------  1 mongodb  mongodb    64M Sep  4 03:41 bongo.0
-rw-------  1 mongodb  mongodb   128M Sep  4 02:04 bongo.1
-rw-------  1 mongodb  mongodb   256M Sep  4 02:47 bongo.2
-rw-------  1 mongodb  mongodb   512M Sep  4 03:42 bongo.3
-rw-------  1 mongodb  mongodb   1.0G Sep  4 03:42 bongo.4
-rw-------  1 mongodb  mongodb   2.0G Sep  4 03:42 bongo.5
-rw-------  1 mongodb  mongodb    16M Sep  4 03:42 bongo.ns
drwxr-xr-x  2 mongodb  mongodb   512B Sep  4 12:25 journal
-rw-------  1 mongodb  mongodb    64M Sep  4 12:26 local.0
-rw-------  1 mongodb  mongodb    16M Sep  4 12:26 local.ns
-rwxr-xr-x  1 mongodb  mongodb     4B Sep  4 12:25 mongod.lock
-rw-r--r--  1 mongodb  mongodb    43K Sep  4 12:27 mongod.log

root@skrot:/var/db # mongo
MongoDB shell version: 2.6.7
connecting to: test
> show dbs
admin  (empty)
bongo  3.952GB
local  0.078GB
> 

root@skrot:/var/db # tar -cf /root/db.tar mongodb/
root@skrot:/var/db # ls -lh /root/db.tar 
-rw-r--r--  1 root  wheel   1.7G Sep  4 13:17 /root/db.tar

root@skrot:/var/db # tar --list -tf /root/db.tar
drwxr-xr-x  0 mongodb mongodb     0 Sep  4 03:45 mongodb/
-rw-r--r--  0 mongodb mongodb 46613 Sep  4 13:12 mongodb/mongod.log
-rwxr-xr-x  0 mongodb mongodb     4 Sep  4 12:25 mongodb/mongod.lock
drwxr-xr-x  0 mongodb mongodb     0 Sep  4 12:25 mongodb/journal/
-rw-------  0 mongodb mongodb 16777216 Sep  4 12:26 mongodb/local.ns
-rw-------  0 mongodb mongodb 67108864 Sep  4 12:26 mongodb/local.0
-rw-------  0 mongodb mongodb 16777216 Sep  4 03:42 mongodb/bongo.ns
-rw-------  0 mongodb mongodb 67108864 Sep  4 03:41 mongodb/bongo.0
-rw-------  0 mongodb mongodb 134217728 Sep  4 02:04 mongodb/bongo.1
-rw-------  0 mongodb mongodb 268435456 Sep  4 02:47 mongodb/bongo.2
-rw-------  0 mongodb mongodb 536870912 Sep  4 03:42 mongodb/bongo.3
-rw-------  0 mongodb mongodb 1073741824 Sep  4 03:42 mongodb/bongo.4
-rw-------  0 mongodb mongodb 2146435072 Sep  4 03:42 mongodb/bongo.5
-rw-------  0 mongodb mongodb      16384 Sep  4 12:26 mongodb/journal/j._0


Is there any way to make du, ls etc. "align" to report the same instead of
wildly varying numbers, or a way to make ls indicate sparse file if this is the
cause?

This is 10.2-RELEASE-p2 amd64, generic kernel, non-journaled UFS on MBR.

-- 
You are receiving this mail because:
You are the assignee for the bug.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-202891-8>