[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: strange behaviour of df command



Thanks but do u have explaination for dummies. This sounded greek to me :-)

On 10/10/06, Manuel Arostegui Ramirez <manuel todo-linux com> wrote:

El Martes, 10 de Octubre de 2006 15:58, Atul Tyagi escribió:
> Hi All,
>
> I am facing a little problem. I guess its more of a conceptual problem
> rather than a OS issue.
>
> One of my software raid partiton /dev/md4 is about 30 GB. I had put a
file
> of about 18GB in that jus for few mins and then deleted that. Now even
> after about 6 hrs. My RHEL4 system gives me weird output. following are
the
> outputs that might help you understand.
>
> df -h
> ===
>
> [root pingu ~]# df -h
> Filesystem            Size  Used Avail Use% Mounted on
> /dev/md0              5.0G  2.7G  2.1G  56% /
> /dev/md1               99M   17M   78M  18% /boot
> none                 1014M     0 1014M   0% /dev/shm
> /dev/md2              5.0G  190M  4.5G   4% /var
> /dev/md4               30G   22G  5.9G  79% /usr/local/test
>
> du -hs
> =====
> [root pingu ~]# du -hs /usr/local/test
> 2.7G    /usr/local/test
>
> Can some one please clear my doubt and explain why there is a such a
hugh
> difference in both the commands. Disk usage shown by df -h is 22G where
as
> du shows 2.7G.
>
> Would appriciate any pointer to this problem.
>
> Thanks,
>
> Atul

quote from: http://www.acersupport.com/ess/articles/articles/14.cfm

You may often see a difference in the output of the two commands "du" and
"df". For example, a df -t is executed on a system and it comes back with
the
following:

       (/dev/root ):     216000 blocks      41950 i-nodes
              total:     260460 blocks      43392 i-nodes

If you subtract the total blocks free from the total available you get:
44460.
The command du -s (from the root directory) shows: 39130. This is a
discrepancy of 5300 blocks. However, there is a big difference in how
these
two utilities work. The df command takes a look at the freelist and gives
a
picture of how many blocks are available for use. The du command takes a
snapshot of the blocks in use by a file or directory, BUT, neither does it
count the blocks used by the directory entries themselves, nor does it
count
the blocks used by special files (ie. device files, named pipes, etc.).

So, if you want to get an approximation of what is in use from looking at
the
df -t output you need to perform one more step.

Perform the subtraction to determine the number of i-nodes in use and then
multiply that by 4. When you add that value to the one you got previously
you
will get an approximation of the total blocks in use. This will still not
match exactly!

The general point is that things aren't always as they seem at first
glance.
There are many utilities in UNIX. Determine what it is that you really
want
to know and then use the appropriate tool.

--
Manuel Arostegui Ramirez.

Electronic Mail is not secure, may not be read every day, and should not
be used for urgent or sensitive issues.

--
redhat-list mailing list
unsubscribe mailto:redhat-list-request redhat com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]