- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- unable to determine tmp filesystem usage
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2005 08:24 PM
03-04-2005 08:24 PM
I have a HP 11i server on which the /tmp filesystem is 2.3 GB. I am unable to determine the usage of the /tmp filesystem . The output of df -k /tmp and du -sk /tmp show a large difference.Following are the output of df and du of /tmp
df -k /tmp
/tmp 2451328 total allocated Kb
825656 free allocated Kb
1625672 used allocated Kb
66 % allocation used
du -sk /tmp
55152 /tmp
I am unable to understand why df shows 1.6 GB used in /tmp but du shows only 55 MB.
Please guide me in sorting this out.
Regs,
Nad
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2005 08:56 PM
03-04-2005 08:56 PM
Re: unable to determine tmp filesystem usage
#df -k /tmp
#bdf /tmp Refer to attached!
df list by block so I think 1.6GB/2=55MB
Can anyone correct me if I'm mistaken
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2005 09:24 PM
03-04-2005 09:24 PM
Re: unable to determine tmp filesystem usage
I think you get different values, because inode of some temporary file was removed. so du when it counts the sizze of files does not count it, but df does.
It happens when you remove some files when some program still uses it, so the pointer to the file still exists and the space is not deallocated, but the inode removed and you can't see the file with ls, du etc.
Did you remove some files from /tmp whithout checking is they are still in use by some program?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2005 09:29 PM
03-04-2005 09:29 PM
Re: unable to determine tmp filesystem usage
To check what programs use /tmp do: lsof /tmp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2005 10:41 PM
03-04-2005 10:41 PM
Re: unable to determine tmp filesystem usage
So I havent deleted any files later on so
1) what could be the cause ?
As suggested may be files were used by some process when they were deleted - in such a case wont the
2) process give any error ?
3) how to determine how the files are getting deleted if any ?
4) What is the solution to this problem ?
Regs,
Nad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2005 11:01 PM
03-04-2005 11:01 PM
Re: unable to determine tmp filesystem usage
First, I'll list the files by size in /tmp to find out what files are growing:
du -k /tmp|sort -nbr|pg
The solution, I'll remove /tmp FS and recreate it again?
Backup whatever you need from /tmp and create an Ignite recovery tape before doing anything.
Maybe someone else has a better idea.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2005 11:06 PM
03-04-2005 11:06 PM
Re: unable to determine tmp filesystem usage
http://hpux.connect.org.uk/hppd/cgi-bin/search
It'll help in the long run
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2005 11:17 PM
03-04-2005 11:17 PM
Re: unable to determine tmp filesystem usage
No, process won't give error message. Well, it depends on how the program was written, but it's not mandatory that an error will be raised, it's not windows after all.
To recreate /tmp? I don't think it's very wise, because it will require boot and as long as you don't have a problem with /tmp, and you don't, because there are still free space, I wouldn't do it.
By the rule, I always delete file in temporary filesystems like /tmp and /var/tmp, in two steps:
1. cat /dev/null >
2. rm
In first step I make sure that the space is deallocated, because I still have the inode and in the second step I remove the inode.
From my point of view, there are 2 solutions:
1. Get lsof and analuze the programs that uses /tmp. Can be difficult and time consuming.
2. Reboot. This way you can be sure that the program that uses /tmp is killed and the space will be free.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2005 11:22 PM
03-04-2005 11:22 PM
Re: unable to determine tmp filesystem usage
2.3GB for a root file system /tmp is too high.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2005 12:03 AM
03-05-2005 12:03 AM
Re: unable to determine tmp filesystem usage
Good method to clear the /tmp filesystem.
I have a 2 questions for you.If your logic that inodes are existing which are occupying space whereas files are deleted -
1) Deleting a file means freeing the inode - otherwise the filesystem superblock will be in invalid state if we say that file is deleted but space is not freed.
2) If your logic is correct then the output of find /tmp | wc -l should vary a lot from the output of bdf -i /tmp which shows the number of inodes.
find /tmp | wc -l gives 6636
and bdf -i gives 6646 inodes used
which are almost same.
Please can you explain this
Regs,
Nad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2005 12:14 AM
03-05-2005 12:14 AM
Re: unable to determine tmp filesystem usage
2. Why do you think it's should vary a lot? It's really depends on the system's state. Now you have a difference, which can be a very good explanation of the setuation that you have in /tmp. du output differs from df output.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2005 03:05 AM
03-08-2005 03:05 AM
Re: unable to determine tmp filesystem usage
I tried from one session
sh 2.sh | tee test_vol/testfile
2.sh script -
while true
do
dmesg
sleep 10
done
I allowed this to run for some time and then while the program was still running I removed the file , then after some time killed the process. Then found out that the space was released.Is this correct method for checking what you asked.
Can you tell me how I need to check
Regs,
Nad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2005 03:12 AM
03-08-2005 03:12 AM
Re: unable to determine tmp filesystem usage
You can check what files are being used as follows.
fuser -cu /tmp
fuser -u /tmp/somefile
lsof +D /tmp
lsof -f -- /tmp
read man pages of those commands.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2005 04:15 AM
03-08-2005 04:15 AM
Re: unable to determine tmp filesystem usage
1) I have already tried using the fuser command - it shows which processes are using the /tmp filesystem.
2)I do not have the lsof command in my system.
3)The test I carried out released the space even though I removed the file while still the process using it was running - which is contrary to the Alexs explanation.
4) Finally the question still remains that why is the used space in df increasing if noone is removing any more files in /tmp
Please if someone can help me in sorting out this problem.
Regs,
Nad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2005 04:42 AM
03-08-2005 04:42 AM
SolutionI suggest that you take a look at it. It can be found here:
http://hpux.connect.org.uk/hppd/hpux/Sysadmin/lsof-4.74/
About the test that "failed", well, I don't know exactly what you did and maybe there are situations that file is removed after all, but in the most cases the space remains.
Regarding /tmp, I'm out of ideas right now ;)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2005 05:34 AM
03-08-2005 05:34 AM
Re: unable to determine tmp filesystem usage
Once you have lsof, issue the following command:
lsof -a +L1 /var
This will list all processes that have open files in /var that have been unlinked.
The output looks like this:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NLINK NODE NAME
syslogd 708 root 10w VREG 64,0x9 62142886 0 16607 /var (/dev/vg00/lvol9)
atswasdO8 1467 cck 6w VREG 64,0x9 181 0 617 /var (/dev/vg00/lvol9)
swagentd 1866 root 5u VREG 64,0x9 41 0 145 /var (/dev/vg00/lvol9)
In the example I give, syslogd has a large file in /var that has been unlinked. (I did this by deleting syslog.log.) Once I kill syslogd (or kill -HUP the process) the open file is released, the space is freed, and life goes on.
Hope it helps
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2005 05:36 AM
03-08-2005 05:36 AM
Re: unable to determine tmp filesystem usage
If you know the processes that have unlinked open files and fix them, my guess is that your problem will go away.
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2005 06:53 PM
03-18-2005 06:53 PM
Re: unable to determine tmp filesystem usage
Finally I managed to get lsof onto my system - as this is production system it took time for getting it done.
Finally I ran lsof -a +L1 /tmp and o/p is
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NLINK NODE NAME
vxsvc 1841 root 3u unix 64,0x5 0t0 0 32 /tmp/portal (0
x4b2029c0)
sqlplus 2864 dbaauto 0u REG 64,0x5 310 0 1395 /tmp (/dev/vg0
0/lvol5)
sqlplus 2909 dbaauto 0u REG 64,0x5 309 0 1396 /tmp (/dev/vg0
0/lvol5)
sqlplus 2926 dbaauto 0u REG 64,0x5 313 0 1397 /tmp (/dev/vg0
0/lvol5)
sqlplus 3002 dbaauto 0u REG 64,0x5 312 0 1399 /tmp (/dev/vg0
0/lvol5)
sqlplus 3015 dbaauto 0u REG 64,0x5 308 0 1393 /tmp (/dev/vg0
0/lvol5)
tee 7977 controlm 4u REG 64,0x5 7065 0 74 /tmp (/dev/vg0
0/lvol5)
tnslsnr 10998 oracle 3u REG 64,0x5 2377686926 0 329 /tmp (/dev/vg0
0/lvol5)
snmpdm 25922 root 2w REG 64,0x5 0 0 3160 /tmp (/dev/vg0
0/lvol5)
awservice 26532 root 3w REG 64,0x5 262 0 714 /tmp (/dev/vg0
0/lvol5)
aws_orb 26535 root 3w REG 64,0x5 262 0 714 /tmp (/dev/vg0
0/lvol5)
aws_sadmi 26538 root 3w REG 64,0x5 262 0 714 /tmp (/dev/vg0
0/lvol5)
caiLogA2 26539 root 3w REG 64,0x5 262 0 714 /tmp (/dev/vg0
0/lvol5)
caiUxOs 26544 root 3w REG 64,0x5 262 0 714 /tmp (/dev/vg0
0/lvol5)
cai_UxOs_ 26554 root 3w REG 64,0x5 262 0 714 /tmp (/dev/vg0
0/lvol5)
Also please see o/p of lsof +D /tmp - I have pasted only tnslsnr entry related o/p
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
tnslsnr 10998 oracle 12u unix 64,0x5 0t0 330 /tmp/.oracle/s#109
98.1 (0x5bdb0b80)
tnslsnr 10998 oracle 13u unix 64,0x5 0t0 331 /tmp/.oracle/sEXTP
ROC (0x5ec53a00)
This indicates that almost all memory is consumed by the tnslsnr process.
Now I have 2 questions.
1) Will stopping the listener and then starting it will release the space or I need a reboot of the system ? - Since this is a production system please let me know the shortest time taking solution.
2) Why is tnslsnr taking so much space ? this is Oracle 9.2.0.5 version.
Alex/John - I am giving you 9 points each Alex for providing good info on lsof and John for guiding in the use of lsof to determine the prob.
Please answer my questions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2005 08:55 PM
03-18-2005 08:55 PM