LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Changing the default /tmp location (https://www.linuxquestions.org/questions/linux-newbie-8/changing-the-default-tmp-location-230885/)

nws_linux 09-15-2004 08:27 AM

Changing the default /tmp location
 
Hello:
All rookies here, trying to install RedHat Linux ES 3.0.
While doing the initial install, we forgot to add a /tmp partition. Now, my root partition contains only 250MB of space. By default, the temporary variables are stored in /root/tmp. Is there any way I can edit this location to point somewhere else ?
Any ideas are welcome. Thanks.

rjlee 09-15-2004 08:34 AM

First create a temporary directory somewhere with more space. Let's call this /home/tmp for the sake of example.

If you login in single-user mode, you can delete (rm -rf) the tmp directory. You can then create a symbolic link to the new directory with:
Code:

ln -s /root/tmp /home/tmp
This effectively remaps the /root/tmp directory to /home/tmp.

Another alternative is to mount another partition onto /root/tmp, possibly a tmpfs partition (tmpfs is held in memory, is not preserved between reboots, and doesn't need a physical partition. But it does tend to eat up RAM). I think that's:
Code:

rm -rf /root/tmp/*
mount /root/tmp -t tmpfs

This will allow you to store whatever you like in /root/tmp without eating up space on /.

By the way, I've assumed that you meant /root/tmp as you said, and didn't use /root to mean “the root directory” (i.e./) If not, replace all /root/ with just / in the above.

nws_linux 09-15-2004 09:07 AM

Thanks so much. I am going to try that out immediately and will let you know what happens.
By /root I meant "the root directory".

J.W. 09-15-2004 12:35 PM

Just for clarification, let me reiterate rjlees's comment: "/root" is not the root directory, "/" is. The / directory (aka "root directory") is the very top level directory, and the one within which all other directories are created. The "/root" directory is simply the home directory of the root user.

As you know, for each regular user account that you create, a separate directory will be created under /home. If you created a user called "nws" then you would also have a directory called "/home/nws". For the root user, the equivalent of that home directory is "/root". -- J.W.

nws_linux 09-15-2004 01:34 PM

Yeah..understood that.
We couldn't get the /tmp to point elsewhere. Any ideas ?

btmiller 09-15-2004 02:18 PM

What exact problem did you have when you tried the ln command that rjlee suggested? Did you try mounting something new on /tmp (i.e. a ramdisk or loop filesystem)? Please tell us precisely what went wrong, so we can help you.

nws_linux 09-16-2004 10:45 AM

Actually, we created a lable for /tmp in the /etc/fstab and rebooted the server. Worked.


All times are GMT -5. The time now is 06:15 AM.