Solved

Increase /tmp size

Posted on 2014-09-19
7
1,027 Views
Last Modified: 2014-09-21
Hi

I am using Centos 6.3 64 bit and have following partitions:

Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg-root   1.8T  493G  1.3T  29% /
tmpfs                 7.8G  8.6M  7.8G   1% /dev/shm
/dev/md0              243M   29M  202M  13% /boot
/dev/mapper/vg-tmp   1008M  959M     0 100% /tmp


I need to increase /tmp size. LVM is following:
[root@scm ~]# vgdisplay 
  --- Volume group ---
  VG Name               vg
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  4
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                3
  Open LV               3
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               1.82 TiB
  PE Size               32.00 MiB
  Total PE              59601
  Alloc PE / Size       59600 / 1.82 TiB
  Free  PE / Size       1 / 32.00 MiB
  VG UUID               Yg3Tb1-H2eg-dtuN-tvl8-kpi3-oFhr-X1eZC0
   
[root@scm ~]# lvdisplay 
  --- Logical volume ---
  LV Path                /dev/vg/root
  LV Name                root
  VG Name                vg
  LV UUID                eLDqgA-cXM6-c0yw-yN7M-q35J-dNV1-9sYGjr
  LV Write Access        read/write
  LV Creation host, time ergo.lusovps.com, 2012-11-05 01:53:29 -0600
  LV Status              available
  # open                 1
  LV Size                1.81 TiB
  Current LE             59317
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     4096
  Block device           253:0
   
  --- Logical volume ---
  LV Path                /dev/vg/tmp
  LV Name                tmp
  VG Name                vg
  LV UUID                f0zmre-FaVR-856g-gCWU-FI10-xzfj-tE62GF
  LV Write Access        read/write
  LV Creation host, time ergo.lusovps.com, 2012-11-05 02:21:29 -0600
  LV Status              available
  # open                 1
  LV Size                1.00 GiB
  Current LE             32
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     4096
  Block device           253:2
   
  --- Logical volume ---
  LV Path                /dev/vg/swap
  LV Name                swap
  VG Name                vg
  LV UUID                fDkOaZ-BVGm-FcFR-rf7L-CJyq-ODjB-Y0Fcyu
  LV Write Access        read/write
  LV Creation host, time ergo.lusovps.com, 2012-11-05 02:21:31 -0600
  LV Status              available
  # open                 1
  LV Size                7.84 GiB
  Current LE             251
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     4096
  Block device           253:1

Open in new window


Can someone please guide me increasing /tmp size without any risk of loosing data. This is a production server. I need the size of /tmp to be 30GB.

Thanks in advance.
0
Comment
Question by:sysautomation
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 8

Accepted Solution

by:
Pepe2323 earned 500 total points
ID: 40333398
Hi

The first thing i can see is that u don't available space on the Volume group

Free  PE / Size       1 / 32.00 MiB

So the options are shrink root in order to release those 30 G you need it or add a new disk

Shrink Steps can be find on this link
http://rbgeek.wordpress.com/2013/02/11/how-to-reduce-the-root-partition-in-lvm/
 i prefer u check the link be cause it also has images and do all steps with details than explain it here.

Once you have those 30G release then you will be able to see it on the Volume group

vgdisplay vg

take a look to this:

Free  PE / Size

To extend TMP

first extend de logical volume

lvextend /dev/vg/tmp -L + 30G

Then Extend the file system

resize2fs /dev/vg/tmp

df -h and now u shall see the new space


Regards.
0
 
LVL 61

Expert Comment

by:gheist
ID: 40333604
install "system-config-lvm-gui"
and it will do all the complexities behind nice GUI.
0
 
LVL 76

Expert Comment

by:arnold
ID: 40334030
You would need to use lvresize -30GB  on the root it seems that during the configuration you did not create a swap partition which is added/reflected as /tmp

Then you would use lvresize to increase /tmp

For
Consider future partitioning
/boot 500M-1g
Swap
/
/usr 5G
/var 5G
/var/log 2G
/home
The non identified sizes depend what the system does.

Please fdisk -l
Or gparted --list

If you are already using software raid /boot. Setting up raided volumes for /var /usr and other booting required mount points will provide for disk tolerance. Data on non-raided would still be lost.
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

Author Comment

by:sysautomation
ID: 40334039
Thank you all. The server is running software RAID 10.

Is there any risk involved in shrinking root partition?
0
 
LVL 76

Expert Comment

by:arnold
ID: 40334044
There is always risk. Such that one should always have a good backup.

If you have a test system, you shoul try the procedure there.

You need to be comfortable with it.


/tmp what is in there?  You should have a process that simply deletes all from it, or based on age I.e. Anything older than 3 days
Find /tmp -mtime +3 -exec rm {}\;
The above will delete files older than three days.
0
 
LVL 61

Expert Comment

by:gheist
ID: 40334122
Ubuntu puts /tmp in ramdisk....
0
 

Author Closing Comment

by:sysautomation
ID: 40335983
Thanks
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now