[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 513
  • Last Modified:

Linux du command question

I'm not sure where it is reporting correct or not, but here is the output from the box.

# df  -h  |  grep  -i  tmp
tmpfs                 2.0G     0  2.0G   0% /dev/shm
/dev/mapper/vg-tmp    2.0G  148M  1.8G   8% /tmp

As you can see 148 Meg used

When I use du commad, it shows only  62+19+ .016 +.004,  I'm not sure where those 60 Meg come from?  Isn't  it suppose to show only 80 M ?


#du  -sh  *
4.0K    x.log
16K     lost+found
19M     x123.log
62M     z123.log
0
mokkan
Asked:
mokkan
  • 4
  • 3
1 Solution
 
omarfaridCommented:
the file system space is of two type:

1- files, directories (data)
2- filesystem overhead blocks

When you use the df command then you get used space by both

when you use the du command then you get info about files and directories only.

So, the output is not the same
0
 
mokkanAuthor Commented:
Thank you very much. How do we calculate the overhead blocks?
0
 
omarfaridCommented:
it depends on the file system type, but it is between 5 to 10% of the partition size.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
mokkanAuthor Commented:
Thank you very much. The problem is df is showing as free, but there is a disk full message. I belive it is due to inode. How can i create  inode manually to reproduce the problem?
0
 
omarfaridCommented:
you can not create inodes. inodes are created while creating filesystem and on some types of filesystems they are created dynamically when it is needed by the OS.

What is the problem you are trying to solve?

Some times you see filesystem usage over 100% and this is because the inode space is used for files and dir. If you see file system full then try to delete some files like logs, etc.
0
 
mokkanAuthor Commented:
thank you very much.  It looks like inode space is used for directory and files.  From the inode number, can we find out how much space on the specific file system?
0
 
omarfaridCommented:
the inode holds info related to a file or a directory like starting block, size, owner, permissions, etc. inode number can't tell you size of the file system. The filesystem has internal table of allocated and free disk blocks and based on that it knows how much space is allocated and how muck is free.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now