LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 07-25-2014, 08:16 PM   #1
qrange
Senior Member
 
Registered: Jul 2006
Location: Belgrade, Yugoslavia
Distribution: Debian stable/testing, amd64
Posts: 1,061

Rep: Reputation: 47
move /tmp


how to move /tmp to different drive?
using KDE, Debian testing amd64.
 
Old 07-25-2014, 08:27 PM   #2
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Create a partition on the new disk for /tmp, create a filesystem on it, add an entry to your fstab (or, if you use systemd, a .mount file) for /tmp.
Reboot, or manually mount /tmp to its new location. You may want to boot into single user mode, to clear out any cruft in the old /tmp location, just mounting the new one over the old stuff will only hide that cruft, but not delete it.
 
1 members found this post helpful.
Old 07-25-2014, 08:27 PM   #3
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Create a partition on the new disk for /tmp, create a filesystem on it, add an entry to your fstab (or, if you use systemd, a .mount file) for /tmp.
Reboot, or manually mount /tmp to its new location. You may want to boot into single user mode, to clear out any cruft in the old /tmp location, just mounting the new one over the old stuff will only hide that cruft, but not delete it.
 
1 members found this post helpful.
Old 07-25-2014, 08:29 PM   #4
qrange
Senior Member
 
Registered: Jul 2006
Location: Belgrade, Yugoslavia
Distribution: Debian stable/testing, amd64
Posts: 1,061

Original Poster
Rep: Reputation: 47
thanks Tobi.
but I'd like to move it to a directory on a different drive, not partition.
I've tried 'ln -s' but that didn't work.
 
Old 07-25-2014, 08:53 PM   #5
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,781

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
/tmp can be needed during the boot sequence before other filesystems have been mounted. Making /tmp a symlink would break that rather badly. You could use "mount --bind /some/directory /tmp", or in /etc/fstab:
Code:
/some/directory  /tmp  none  bind   0 0
The mount point directory would still be there and available for early users
 
1 members found this post helpful.
Old 07-26-2014, 08:22 PM   #6
widget
Senior Member
 
Registered: Oct 2008
Location: S.E. Montana
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,628

Rep: Reputation: 497Reputation: 497Reputation: 497Reputation: 497Reputation: 497
Quote:
Originally Posted by qrange View Post
thanks Tobi.
but I'd like to move it to a directory on a different drive, not partition.
I've tried 'ln -s' but that didn't work.
This should work exactly the same way as any new partition. You are pointing your system at a partition. As long as it exists your system doesn't care what drive it is on, only that you point it in the correct direction.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bad exit status from /var/tmp/rpm-tmp.Cs9Mt5 (%build) imbrij Linux - Virtualization and Cloud 11 10-27-2012 10:55 AM
[SOLVED] Move /tmp to another drive Daedra Slackware 15 10-04-2012 08:13 AM
[SOLVED] Move browser tmp to RAM with Opera Blasphemous Linux - Newbie 2 12-08-2011 12:16 PM
Can't login, says tmp directory full but tmp file is empty! Could be linked to MySQL? bethanlowder Fedora 7 09-25-2009 07:17 AM
move /tmp puzz_1 Linux - Newbie 3 06-30-2003 02:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 09:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration