Results 1 to 4 of 4

Thread: [SOLVED] df -h and du -sch * show different sizes

  1. #1
    Join Date
    Jul 2008
    Beans
    2

    [SOLVED] df -h and du -sch * show different sizes

    Hi everybody,

    I am running a FreeBSD system but this here is the most active forum that I found and I assume that my question has nothing todo with OS specific circumstances.

    So, the var-folder of my root-partition is full:

    > df -h

    /dev/mirror/gm0s1a 248M 101M 127M 44% /
    /dev/mirror/gm0s1e 248M 29M 199M 13% /tmp
    /dev/mirror/gm0s1f 2.9G 2.3G 368M 87% /usr
    /dev/mirror/gm0s1d 248M 219M 8.8M 96% /var <--- FULL

    but when I use du -sch * in the var-folder I receive the followin information

    2,0K account
    6,0K at
    18K backups
    6,0K cron
    45M db
    2,0K empty
    2,0K games
    2,0K heimdal
    4,0K lib
    1,6M log
    346K mail
    4,0K msgs
    40K named
    2,0K preserve
    48K run
    2,0K rwho
    24K spool
    294K tmp
    2,8M www
    50M total

    it shows me that I only use 50 MB. How can that be? how can I detect what on my partition uses so much space?

  2. #2
    Join Date
    Jun 2008
    Beans
    4
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: df -h and du -sch * show different sizes

    huuuuuuuuuum, i too faced /VAR full............poor me had to resize with live cd and messed up things. now my /usr is getting 35% how can i resize /VAR which is 14GB and allocate space to /USR...
    thanks

  3. #3
    Join Date
    Apr 2008
    Location
    Germany - Berlin
    Beans
    340

    Re: df -h and du -sch * show different sizes

    Here is an article about that issue: http://www.cyberciti.biz/tips/freebs...nt-output.html

    In short: If you have a file in a *nix system which is still used by a process and you delete it its not gone until the process ends. However du doesn't see it and doesn't summarize it, df however only looks at the free space and since the file is not marked as free space yet (because the process still uses it) it shows more used space the du.

  4. #4
    Join Date
    Jul 2008
    Beans
    2

    Re: df -h and du -sch * show different sizes

    thanks a lot for this article. that was exactly what I was looking for.

    problem solved! your guys are great!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •