Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Increase /tmp size

Posted on 2014-09-19
7
Medium Priority
?
1,800 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 1500 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 62

Expert Comment

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

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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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 80

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 62

Expert Comment

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

Author Closing Comment

by:sysautomation
ID: 40335983
Thanks
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
This article will show you step-by-step instructions to build your own NTP CentOS server.  The network diagram shows the best practice to setup the NTP server farm for redundancy.  This article also serves as your NTP server documentation.
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses
Course of the Month6 days, 2 hours left to enroll

773 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