Find the answer to your Linux question:
Results 1 to 9 of 9
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  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 D-cat's Avatar
    Join Date
    Jan 2009
    Location
    Bounce between Dover, NH - Shapleigh, ME
    Posts
    1,638
    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. $spacer_open
    $spacer_close
  5. #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)

  6. #5
    Linux Guru D-cat's Avatar
    Join Date
    Jan 2009
    Location
    Bounce between Dover, NH - Shapleigh, ME
    Posts
    1,638
    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.

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

  8. #7
    Linux Guru D-cat's Avatar
    Join Date
    Jan 2009
    Location
    Bounce between Dover, NH - Shapleigh, ME
    Posts
    1,638
    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.

  9. #8
    Just Joined!
    Join Date
    Aug 2011
    Posts
    10

    Ok To Force If "in use"?

    Quote Originally Posted by D-cat View Post

    mv /tmp /mnt/new/location/tmp
    can this be forced in any way, if the tmp directory is in-use?

    on puppy linux, even if i exit to command prompt, the tmp dir is still "in use". It cannot be accessed from another OS.

    thanks

    update:

    when tmp is not in-use, i get this error:
    "inter-device move failed... unable to remove target... Is a directory"

    suggestions appreciated
    Last edited by johnywhy; 07-02-2012 at 01:08 AM.

  10. #9
    Administrator jayd512's Avatar
    Join Date
    Feb 2008
    Location
    Kentucky
    Posts
    5,023
    Seeing as this thread is almost 4 years old, I'm gonna lock it down.
    If you still have questions about this, though, please feel free to start a new thread.
    Jay

    New users, read this first.
    New Member FAQ
    Registered Linux User #463940
    I do not respond to private messages asking for Linux help. Please keep it on the public boards.

Posting Permissions

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