Adding a separate /tmp

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat Adding a separate /tmp
# 1  
Old 03-14-2014
Adding a separate /tmp

I have RHEL 6.5 VM. Its default /tmp is small and I have given a extra lun from storage team (/dev/sdc) to create a separate /tmp.
I have option to take small downtime for 30 minutes, so I wanted to make sure, if I am following correct steps. here is current setup :-
Code:
[root@VMTBESP11 ~]# df -h | grep -i tmp
tmpfs                     3.9G     0  3.9G   0% /dev/shm
[root@VMTBESP11 ~]# cat /etc/fstab | egrep -i "tmp|swap"
/dev/sda2       swap            swap    defaults                        0 0
tmpfs           /dev/shm        tmpfs   defaults                        0 0
[root@VMTBESP11 ~]# cd /tmp
[root@VMTBESP11 tmp]# df -h .
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3        16G  6.4G  8.4G  44% /

Just replacing /dev/sda2 to /dev/sdc in /etc/fstab and reboot will work ? Do I need to write file-system also on this new device ? Current file-system is ext4 for all other file-system.
# 2  
Old 03-14-2014
/tmp is a filesystem mounted on root (/). What has this to do with "sda2" (swap), downtime or rebooting?

If you need more space in /tmp, just add the LUN you got from storage to the root VG and extend /tmp as you would any other filesystem.
# 3  
Old 03-14-2014
Scott, I have been asked to create a new and separate file-system (instead of part of root). Current root is 16 GB and /tmp to be created with that new lun of 250GB.
# 4  
Old 03-14-2014
/tmp has not a lot to do with swap, and as /tmp is only a directory off /, there's nothing in /etc/fstab about it.

Take the 250GB LUN, create an fdisk LVM partition with it, create a VG, LV and ext4 fs of it and mount it under /tmp, remembering to add it to /etc/fstab.

Ideally you'd want some downtime to clean out /tmp under / before mounting the new FS, so if you could get that, great! A reboot isn't strictly required, either way.
# 5  
Old 03-14-2014
Well, it looks like he currently is not using LVM since / is mounted from /dev/sda3. Given that, I don't see a lot of reason to setup a PV only for /tmp. The resulting config would seem a bit strange.

I have only recently convinced my company to switch to LVM. Corporate inertia can be a pain sometimes.
This User Gave Thanks to Perderabo For This Post:
# 6  
Old 03-14-2014
We are not using LVM for root. But for application file-systems, they are always in LVM.
Scott, should I create a simple /dev/vg_tmp/lv_tmm then mkfs.ext4 on that and have a entry in /etc/fstab as below
Code:
/dev/vg_tmp/lv_tmm /tmp ext4 noexec,nosuid,loop 1 1

After this a simple reboot should be able to put everything in place ?
# 7  
Old 03-14-2014
Yes, if you want to go down the LVM route, that sounds fine. (otherwise just partition it using fdisk and mkfs.ext4 that!)

The most compelling reason to reboot is to ensure that processes stop writing to the old FS and start writing to the new one. If you could do that without rebooting (i.e. by restarting applications) then try that. But most VMs these days are likely bastion systems, so it's as well to reboot the VM if you can get away with it!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Adding to an array in an external file, and adding elements to it.

I have an array in an external file, "array.txt", which contains: char *testarray={"Zero", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine"};I want to be able to add an element to this array, and have that element display, whenever I call it, without having to recompile... (29 Replies)
Discussion started by: ignatius
29 Replies

2. Shell Programming and Scripting

Adding new lines to a file + adding suffix to a pattern

I need some help with adding lines to file and substitute a pattern. Ok I have a file: #cat names.txt name: John Doe stationed: 1 name: Michael Sweets stationed: 41 . . . And would like to change it to: name: John Doe employed permanently stationed: 1-office (7 Replies)
Discussion started by: hemo21
7 Replies

3. Solaris

cannot cd /tmp.

Hi All, There's a /tmp. folder on my solaris 9. I can't cd on it bash-2.05# uname -a SunOS cads105ctce 5.9 Generic_122300-30 sun4u sparc SUNW,Sun-Fire-V890 bash-2.05# cd /tmp. bash: cd: /tmp.: No such file or directory bash-2.05# ls -la /tmp. /tmp.: No such file or directory ... (5 Replies)
Discussion started by: itik
5 Replies

4. AIX

problem with tmp

Hello everyone ! I get a box with aix 5.3 and I get the /tmp fs on 100 %. I get a free space to get more bigger my fs but send me a error message. I try to make more bigger with smitty chlv but It doesnt work. Then I try to reduce somethings on the /tmp fs but I cant get in on a... (4 Replies)
Discussion started by: lo-lp-kl
4 Replies

5. AIX

/tmp full

The /tmp is 100% full, I found there are the following big files/directory: 1301500 syslog.out.58 166692 vac 158552 install.dir.2928686 158552 install.dir.2236636 110980 install.dir.2887698 /tmp/vac have some files like : .toc ... (3 Replies)
Discussion started by: rainbow_bean
3 Replies

6. UNIX for Dummies Questions & Answers

what is so special about /tmp/

I know that /tmp is used for memory or swap??? and that it should not be full ??? and that files under /tmp are automatically removed after a reboot??? Is this info true??? thx (16 Replies)
Discussion started by: melanie_pfefer
16 Replies

7. Red Hat

/tmp directory

i heard once that the /tmp directory was a ramfs (swap) that is cleared at reboot time, is this still the case in redhat EL 3 and 4 ? (1 Reply)
Discussion started by: BG_JrAdmin
1 Replies

8. UNIX for Dummies Questions & Answers

monitoring /tmp and /var/tmp for suspicous activity

Hello, does anyone have a script that can check the contents of the /tmp directory and for example e-mail the directory content if anything other than session files are present? Maybe there are better ways to monitor suspicous /tmp and /var/tmp activity, if so I'm listening :) (1 Reply)
Discussion started by: jamesbond
1 Replies

9. UNIX for Advanced & Expert Users

writing to /tmp

Hi all, I need your help. I am using Linux - Mandrake 8.x version. Somehow, the system /tmp directory became unwritable. What can be the problem is this case I am trying to write to /tmp and the permission right for this dir are: drwxrwxrwt 20 root root 1024 Mar 16 17:26... (3 Replies)
Discussion started by: vtran4270
3 Replies

10. UNIX for Dummies Questions & Answers

/tmp is missing ????

Hi, When I type mail command i get the following error : /tmp/Rx7678 : No such file or directory If I try to use the man, i also get an error related to /tmp. I looked at my other servers and found this /tmp file, looked inside it and found that it has some files related to... (1 Reply)
Discussion started by: BAM
1 Replies
Login or Register to Ask a Question