cancel
Showing results for 
Search instead for 
Did you mean: 

temp size

SOLVED
Go to solution
Anoopkumar
Frequent Advisor

temp size

Hi,
I am facing a stange issue,see the below o/p /temp showing differ size in bdf and du .
# bdf .
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol4 2097152 1756472 340680 84% /tmp
# pwd
/tmp
# du -sk .
17144
Please help me to solve this.
Thanks
Anoop
#
9 REPLIES
Ganesan R
Honored Contributor
Solution

Re: temp size

Hi Anoop,

It is because of open files. There are some process having open files on /tmp filesystem.

du will not count open files whereas bdf will count those space as well. Use lsof to find the process having open files and kill if necessary.
Best wishes,

Ganesh.
Ganesan R
Honored Contributor

Re: temp size

Hi,

Command syntax would be,

# lsof +aL1 |grep /tmp

Best wishes,

Ganesh.
Anoopkumar
Frequent Advisor

Re: temp size

Thanks for the replay

# /usr/local/bin/lsof lsof +aL1 |grep /tmp
lsof: status error on lsof: No such file or directory
lsof: status error on +aL1: No such file or directory
lsof 4.77
latest revision: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/
latest FAQ: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/FAQ
latest man page: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/lsof_man
usage: [-?abChlnNoOPRstUvV] [+|-c c] [+|-d s] [+D D] [+|-f[cfgGn]]
[-F [f]] [-g [s]] [-i [i]] [+|-L [l]] [+|-M] [-o [o]]
[-p s] [+|-r [t]] [-S [t]] [-T [t]] [-u s] [+|-w] [-x [fl]] [--] [names]
Use the ``-h'' option to get more help information.
#

it hsowing this error
Taifur
Respected Contributor

Re: temp size

Hi AnoopKumar,

du - Displays a summary of disk usage
http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51_HTML/MAN/MAN1/0102____.HTM

bdf â report number of free disk blocks (Berkeley version)

http://docs.hp.com/en/B2355-90691/bdf.1M.html


Obviously there is a difference in how du and bdf behave.
This may occur if we touch open files.
"du" shows output in a positive view: it shows the number of currently allocated
blocks and counts the blocks you've just deleted as free.

"bdf" has a more negative perspective: it shows the free disk space available.

The difference is here: if a still-active process has allocated blocks (such as
for a logfile that you've just deleted), "bdf" counts these as still occupied.
This won't change until the process closes the file ("deallocates the blocks")
as it usually happens when the process terminates.


Rgds//
Taifur
Dennis Handly
Acclaimed Contributor

Re: temp size

># /usr/local/bin/lsof lsof +aL1 |grep /tmp
>lsof: status error on lsof: No such file or directory

You have an extra "lsof" there.
Check Ganesan's example.
Anoopkumar
Frequent Advisor

Re: temp size

Hi,
Sorry my mistake...
it showing the output.

/usr/local/bin/lsof +aL1 |grep /tmp
snmpdm 1120 root 2w REG 64,0x4 0 0 47 /tmp (/dev/vg00/lvol4)
vmstat 20633 root cwd DIR 64,0x4 8192 0 397 /tmp (/dev/vg00/lvol4)
vmstat 20633 root 1u REG 64,0x4 1786297567 0 229 /tmp (/dev/vg00/lvol4)
vmstat 20633 root 2u REG 64,0x4 1786297567 0 229 /tmp (/dev/vg00/lvol4)

I think taht 1.7 GB is using for vmstat How can find out which process is using how can kill that ??


Thanks
Anoop

Ganesan R
Honored Contributor

Re: temp size

Hi Anoop,

To know more about the process,

#ps -fp

#ps -fp 20633

To kill the process

#kill -9 20633
Best wishes,

Ganesh.
Anoopkumar
Frequent Advisor

Re: temp size

Thanks,

Killed the vmstat process
Jestin John Chacko
Regular Advisor

Re: temp size

Dear anoop
Same error i had faced for the /var file system which is showing 100% but in du -sk its not showing less than the used space in bdf

your question provided a good answer for my issue thanks,now i understood why its happening so.