Find the answer to your Linux question:
Results 1 to 7 of 7
Hi guys, I wonder if it is possible to change the default user /tmp folder in suse 10.2. I checked the env variables but there is none that would define ...
  1. #1
    Linux Newbie
    Join Date
    Feb 2006
    Location
    Slovenia
    Posts
    162

    How to change tmp folder location?

    Hi guys, I wonder if it is possible to change the default user /tmp folder in suse 10.2. I checked the env variables but there is none that would define where the temp folder is. The reason for doing this is, that when I am extracting large compressed rar files cca 10GB I get an error saying something like "cant write do destination folder", so instead of increasing my home parition which is about 20GB large, I thought of moving the tmp to folder to another bigger partition. Any help is welcome, thanks.

  2. #2
    Just Joined!
    Join Date
    Jul 2009
    Posts
    3

    Any Luck

    Did you find a solution to this? I was hoping to move my users tmp file to the root directory so they can't delete it

  3. #3
    Linux Guru
    Join Date
    Jan 2009
    Location
    Dover, NH
    Posts
    1,633
    You can either mount a different drive to /usr/tmp, or you can replace it with a symlink (ln -s) to another location with more space. Any locale change you make to any tmp dirs (/tmp, /usr/tmp, or /var/tmp), make it from a reboot in single mode so you don't bork a running app.

  4. #4
    Just Joined!
    Join Date
    Jul 2009
    Posts
    3
    If i use a symbolic link that will transfer where the tmp files are going but wont I still have the actual "tmp" directory? I was hoping to move that because i'm afraid its going to get deleted (i'm making a distro for old people)

  5. #5
    Linux Guru
    Join Date
    Jan 2009
    Location
    Dover, NH
    Posts
    1,633
    You have to delete (or move) the original folder prior to making the symlink to the new location. Otherwise ln will simply reply File or Folder already exists.

    This is why I suggest you do it in single user mode, or at least without X running. It would be something along the lines of:

    mv /tmp /mnt/new/location/tmp

    ln -s /mnt/new/location/tmp /tmp


    It has to be as root and none of the files under tmp can be in use at the time.

    Also, if you create (as opposed to move) a new folder to redirect tmp, make sure it has universal read/write/execute privileges (777). A temp folder is no good if the user can't write to it.

  6. #6
    Blackfooted Penguin daark.child's Avatar
    Join Date
    Apr 2006
    Location
    West Yorks
    Posts
    4,344
    I think you can also do something like
    Code:
    export TEMPDIR=/new/temp/dir

  7. #7
    Linux Guru
    Join Date
    Jan 2009
    Location
    Dover, NH
    Posts
    1,633
    That should work for programs you're compiling from source and maybe many others, but I'm haunted by the feeling that the very existence of three tmp folders (which are sometimes symlinked to one physical folder) suggests that there are programs where the expected location of a tmp folder is hard encoded. The symlink(s) would be the most effective way to deal with these.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...