Increase /tmp size


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, 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, 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, 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.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


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
 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


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
install "system-config-lvm-gui"
and it will do all the complexities behind nice GUI.
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

Consider future partitioning
/boot 500M-1g
/usr 5G
/var 5G
/var/log 2G
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.
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

sysautomationAuthor Commented:
Thank you all. The server is running software RAID 10.

Is there any risk involved in shrinking root partition?
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.
Ubuntu puts /tmp in ramdisk....
sysautomationAuthor Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.