Operating System - Tru64 Unix
1828593 Members
2110 Online
109983 Solutions
New Discussion

how to free up space in /tmp

 
SOLVED
Go to solution
Zishan
Regular Advisor

how to free up space in /tmp

Dear All,

I wonder if anybody tell me that how can I able to free up the space in my /tmp directory?
I required 400MB free but the current /tmp directory hold the 2gb space out of 256MB is free and its located on the / drive.
Any help would be appreciated.

Regards,
19 REPLIES 19
Jupinder Bedi
Respected Contributor

Re: how to free up space in /tmp

There are so many ways.


1)first of all you need to check which file is the oldest one and not used from a long time . you can delete it .

2) check if there is any tar file or a log files are copied to this /tmp directory . you can delete it without any risk'

3) if there is very big files in /tmp just send an email to a particular user or ask them to delete it .

Note :- /tmp is a temporory folder and users are aware of that if the system will reboot they will lost their data. so you can simply remove the any of the other user file


Good Luck

All things excellent are as difficult as they are rare
Jupinder Bedi
Respected Contributor

Re: how to free up space in /tmp

and one thing more if you dont want to delete anything just copy the bigger files in some another location or also you can gzip or compress your files.
All things excellent are as difficult as they are rare
Zishan
Regular Advisor

Re: how to free up space in /tmp

Thanks for prompt reply.I am new in Unix Tru.
What I found a /tmp folder is created on / (root) drive. When I issue the "df -h /tmp" command it shows that 256MB is free. I dont need any of these files so I just simply delete the /tmp folder from /. After that when I create a new /tmp folder and issue the same command "df -h /tmp" then again 256MB space is free.

am I doing right ? Kindly guide me because there is no file is located in that /tmp folder.

Regards,
Jupinder Bedi
Respected Contributor

Re: how to free up space in /tmp

can you please send me the output of df -h
All things excellent are as difficult as they are rare
Jupinder Bedi
Respected Contributor

Re: how to free up space in /tmp

can you please let me know output of swap -l or whatever alternative command to see the output of swap


and also see if there is any open file which is writing in /tmp directory

use lsof command for that


you can also check it by using

ps -ef | more

and look for which process is trying to write in /tmp directory

kill that process and than try


Good Luck
All things excellent are as difficult as they are rare
Steven Schweda
Honored Contributor

Re: how to free up space in /tmp

> [...] I am new in Unix Tru.

> [...] so I just simply delete the /tmp
> folder from /. [...]

If you're new at it, then it might be wise
not to use "rm" so much until you're less new
at it. ("simply" can have many meanings.)

As usual, it might help if you showed the
actual commands you used, with their actual
output. Around here, for example, "/tmp" is
a symbolic link, not a directory:

urtx# ls -l /tmp
lrwxrwxrwx 1 root system 26 Oct 16 2007 /tmp -> cluster/members/{memb}/tmp

If yours is (or was), then it's not clear
exactly what you've done.

> df -h

A reasonable place to start.

Note that if you delete a file which some
program has open, then the disk space is
still occupied, and it's now harder to find
it.
Zishan
Regular Advisor

Re: how to free up space in /tmp

Hello,
Thanks for your precisoud advices Follwing is my output:
Output is also attached in a Excel file.

df -h

File System Size Used Available Capacity Mounted On

root_domain 2267M 1997M 256M 89% /
/proc 0 0 0 100% /proc
usr_domain#usr 53G 12G 37G 25% /usr
usr_domain#var 53G 3764M 37G 10% /var




It seems root domain file system is treating as /tmp becuasey when I ssued the df -h /tmp the output is same as the root_domain (256M is available).
When I issue "ps -ef | more"
there are more than 50 process showing under /usr/sbin and /usr/bin directories.
Wating for your advice.

Regards,
Jupinder Bedi
Respected Contributor
Solution

Re: how to free up space in /tmp

Not it is very clear . Your /tmp is not a different partition . it is part of / means root directory and in / directory only 256mb is remaining so thats why is showing you 256 mb space remaining .


so if you want to spare some space in /tmp than you need to spare some space in / directory..


if you still have any doubt than please let me know..


Good Luck
All things excellent are as difficult as they are rare
Zishan
Regular Advisor

Re: how to free up space in /tmp

Hello,

Thanks for prompt reply,Yes, I agree with you. What I am doing is I have 37GB available on /usr. I created /tmp directory on /usr instead of using /tmp on root.
Kindly tell me that how can I make /usr/tmp as my /tmp directory for other processes including oracle.

Warm regards,
Steven Schweda
Honored Contributor

Re: how to free up space in /tmp

> [...] how can I make /usr/tmp as my /tmp
> directory [...]

Set TMPDIR to point to your "/usr/tmp"
directory? Some programs follow that.

man tempnam [or "tmpnam"]

> [...] including oracle.

I don't know enough about Oracle software to
know if it uses TMPDIR.

Change the symbolic link for /tmp to point to
your "/usr/tmp" directory? This may cause
problems if anyone tries to use "/tmp" before
"/usr" is mounted.

What are you doing which needs so much space
in "/tmp"?
Zishan
Regular Advisor

Re: how to free up space in /tmp

Hello,
I am installing Oracle database on Unix tru 64bit. As a prerquisite I need 400mb space in /tmp and I have 256MB in \tmp which is created on \ if you read this thread.
I have 37 gb space in /usr drive so I created a /tmp folder in /usr directory. Now I want that oracle uses this /usr/tmp directory as /tmp directory and forget the /tmp on root.

you suggestion would be hightly appreciated.

Regards,
Steven Schweda
Honored Contributor

Re: how to free up space in /tmp

> you suggestion would be hightly appreciated.

> Feb 24, 2010 12:45:14 GMT

Should I type them again?

You might also look around on "/" for 200MB
worth of files which you don't really need,
and then delete (or compress) them.

man du

Look for "-s".
Rob Leadbeater
Honored Contributor

Re: how to free up space in /tmp

Hi,

You could create a new fileset in the usr_domain to be used for /tmp.

# mkfset usr_domain tmp
# mount usr_domain#tmp /tmp

/tmp will then have lots of free space.
You would have to add this new mount point to /etc/fstab to make that persist a reboot.

Cheers,

Rob
Zishan
Regular Advisor

Re: how to free up space in /tmp

Hello Rob,
I really appreciate your kind advice.I want to share something and need your views.I create /tmp filesystem using ur above commands and it created successfully.
-I issue the "df" commands and new /tmp filesystem is showing.
-I add an entry into /etc/fstab file which is "usr_domain#usr /tmp advfs rw 0 2" and restart the system.
-After restart the entry exist in /etc/fstab file but when I issue "df" command there is no /tmp filesystem but entry still exist in fstab file.
- I tried to create the filesystem again with mkfset command but there is error for duplicate file system.

Your help would be appreciated.

Regards,
Steven Schweda
Honored Contributor

Re: how to free up space in /tmp

> [...] I create /tmp filesystem using [yo]ur
> above commands [...]

As usual, it might help if you showed the
actual commands you used, and what happened
when you used them.

What's wrong with this picture?:

> # mount usr_domain#tmp /tmp
> usr_domain#usr /tmp advfs rw 0 2
Zishan
Regular Advisor

Re: how to free up space in /tmp

I used the following command and it works but when I rebooted the system and excute df -h command. There is no /tmp in the output.

#mkfset usr_domain tmp
# mount usr_domain#tmp /tmp
>usr_domain#usr /tmp advfs rw 0 2

Regards
Steven Schweda
Honored Contributor

Re: how to free up space in /tmp

> I used the following command [...]

Which one? Or both?

> [...] and it works [...]

Which means what, exactly?

> [...] but when I rebooted the system and
> excute df -h command. There is no /tmp in
> the output.

Did you fix the obvious error in your
"/etc/fstab" file"? What's there now?
Zishan
Regular Advisor

Re: how to free up space in /tmp

After rebooting the system follwing entry exist in the fstab file

usr_domain#usr /tmp advfs rw 0 2

But when I execute "df -h" there is no /tmp showing in the output. Any idea why ?

Regards,
Steven Schweda
Honored Contributor

Re: how to free up space in /tmp

> [...] Any idea why ?

Only the same one as before.

> What's wrong with this picture?:
>
> > # mount usr_domain#tmp /tmp
> > usr_domain#usr /tmp advfs rw 0 2

Look closely at the mount command, then look
closely at the line in "/etc/fstab". Hint:
"tmp" and "usr" are different.