View previous topic :: View next topic |
Author |
Message |
shmurfect n00b
Joined: 18 Apr 2002 Posts: 19
|
Posted: Fri Apr 19, 2002 5:41 pm Post subject: deleting /tmp directory |
|
|
For some reason my /tmp directory isn't being cleared every reboot. It says it is clearing the /tmp directory when the compter starts up, but it doesn't. What can I do to fix this? |
|
Back to top |
|
|
daos n00b
Joined: 18 Apr 2002 Posts: 50 Location: Virginia, USA
|
Posted: Fri Apr 19, 2002 6:27 pm Post subject: clear /tmp |
|
|
I mount the /tmp folder on the RAM using tmpfs, so the content is gone after reboot. Besides, it's faster since all files are on RAM.
Put this line in /ect/fstab
tmpfs /tmp tmpfs defaults 0 0
Note: the default max size for /tmp on RAM is half of ram size. It's dynamic and only the number of files on /tmp occupies the RAM. You can limit the max size (e.g 32MB):
tmpfs /tmp tmpfs size=32m defaults 0 0
You need to have the tmpfs filesystem (formerly shm) compiled in the kernel to make it work. |
|
Back to top |
|
|
shmurfect n00b
Joined: 18 Apr 2002 Posts: 19
|
Posted: Fri Apr 19, 2002 7:53 pm Post subject: Re: clear /tmp |
|
|
daos wrote: | I mount the /tmp folder on the RAM using tmpfs, so the content is gone after reboot. Besides, it's faster since all files are on RAM.
Put this line in /ect/fstab
tmpfs /tmp tmpfs defaults 0 0
|
hmm - yea - that sounds like a good idea. but say i want large files in the /tmp directory (say iso's or something). Is there any way to have this folder deleted everytime the box is restarted or such without having a ram disk? |
|
Back to top |
|
|
daos n00b
Joined: 18 Apr 2002 Posts: 50 Location: Virginia, USA
|
Posted: Fri Apr 19, 2002 8:01 pm Post subject: |
|
|
You can try this to see if it works.
In the system boot scripts (rc.sysinit for redhat or mandrake), before /tmp is mounted in the script:
rm -rf /tmp
mkdir /tmp
chmod 1777 tmp |
|
Back to top |
|
|
|