LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 05-09-2019, 08:37 AM   #1
madhavramdin
LQ Newbie
 
Registered: Apr 2013
Posts: 13

Rep: Reputation: Disabled
ubuntu 16.04 | move /tmp to secondary partition


Dear Team,

Our /tmp directory is being often filled with temporary files from users running jobs on the machine. As a result, we'd like to move the /tmp directory to a secondary partition so that:

1) / does not get filled up so often when users can't specify TMPDIR in their applications.
2) The secondary partition is a 1TB SSD which will take time to get filled up and because it's SSD, will add up some speed.

I believe an entry should be added to fstab for this device, specifiying the UUID and mountpoint. But as this is a production machine, I would really appreciate some feedback, if anyone has successfully done this change in the past.


I understand that the lifetime of the SSD will be greatly reduced, but this is offset by the gains we shall be having afterwards. I searched on the ubuntu forums but I could only find a procedure for moving /home folders.


Regards,

madhav
 
Old 05-09-2019, 08:54 AM   #2
dc.901
Senior Member
 
Registered: Aug 2018
Location: Atlanta, GA - USA
Distribution: CentOS/RHEL, openSuSE/SLES, Ubuntu
Posts: 1,005

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
So, you have second ssd with partition and filesystem created.
You can check under /dev/disk/by-uuid/ for UUID of the disk.
Then update fstab...

Since you have user jobs writing to /tmp, I would make sure no jobs are running then rename existing /tmp to something else then mount the new partition as /tmp
 
1 members found this post helpful.
Old 05-09-2019, 10:12 AM   #3
madhavramdin
LQ Newbie
 
Registered: Apr 2013
Posts: 13

Original Poster
Rep: Reputation: Disabled
thanks a lot!
 
Old 05-10-2019, 07:03 AM   #4
Steve R.
Member
 
Registered: Jun 2009
Location: Morehead City, NC
Distribution: Mint 20.3
Posts: 521

Rep: Reputation: 98
Quote:
Originally Posted by madhavramdin View Post
Our /tmp directory is being often filled with temporary files from users running jobs on the machine.
Not to detract from having a /tmp directory, but how about having an automated script that deletes the temporary files?
 
Old 05-10-2019, 08:38 AM   #5
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Moderator response

Moved: This thread is more suitable in <Ubuntu> and has been moved accordingly to help your thread/question get the exposure it deserves.
 
Old 05-10-2019, 08:44 AM   #6
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
Quote:
Originally Posted by dc.901 View Post
Since you have user jobs writing to /tmp, I would make sure no jobs are running then rename existing /tmp to something else then mount the new partition as /tmp
You can hardly be sure if /tmp is not in use.
I would rather set it in fstab and reboot. Also need to clean up the original /tmp.
 
2 members found this post helpful.
  


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
(Solved) Bumblebee "Cannot access Secondary GPU, secondary X is not active" Norgi Slackware 0 03-23-2013 11:45 PM
Create file using 'touch ./tmp.$$', file tmp.3941 is created, why? huangyanfeng Linux - General 1 04-13-2004 03:36 AM
"/tmp/sv001.tmp/setup.bin" error while installing OO1.1.0 Choey Linux - Software 0 09-16-2003 04:52 PM
Numerous scb_*.tmp files in /tmp dburk Programming 3 08-18-2003 04:28 PM
Newbie question - /tmp /var/tmp Mr happy Linux - Security 3 01-27-2003 01:03 PM

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

All times are GMT -5. The time now is 12:38 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