{"id":158,"date":"2013-05-30T08:19:15","date_gmt":"2013-05-30T08:19:15","guid":{"rendered":"http:\/\/blog.shineservers.com\/?p=158"},"modified":"2013-05-30T08:19:15","modified_gmt":"2013-05-30T08:19:15","slug":"how-to-increase-size-of-vartmp-and-tmp-centos","status":"publish","type":"post","link":"https:\/\/www.shineservers.com\/2013\/05\/30\/how-to-increase-size-of-vartmp-and-tmp-centos\/","title":{"rendered":"How To Increase size of \/var\/tmp and \/tmp (Centos)"},"content":{"rendered":"<p>I was frequently getting an error message that the \/var\/tmp directory in one of my cPanel CentOS 5.5 server is full and I need to delete some data. A cronjob is already there in crontab to cleanup the temporary data periodically, but I was still getting that error.<\/p>\n<p>I looked at the error log and found that the tmp partition goes full when the scheduled backup runs. Therefore, I had nothing to do but increase the size of the tmp partition. After that, my server runs fine and no issues or error messages since then.<\/p>\n<p><b>Here is How to increase the size of \/var\/tmp and \/tmp partition<\/b><\/p>\n<p>You need to have root access to your server. If not, you can\u00e2\u20ac\u2122t increase the size of \/tmp and \/var\/tmp partition directory, sorry.<\/p>\n<p>Shutdown httpd and mysql using these commands<\/p>\n<div>\n<blockquote>\n<div><span style=\"font-family: Consolas, Monaco, monospace; font-size: 12px; line-height: 18px;\">service httpd stop<\/span><\/div>\n<pre dir=\"ltr\">service mysql stop<\/pre>\n<\/blockquote>\n<\/div>\n<p>First, you need to edit the file securetmp in \/usr\/local\/cpanel\/scripts\/ folder.<\/p>\n<div>\n<blockquote>\n<div><span style=\"font-family: Consolas, Monaco, monospace; font-size: 12px; line-height: 18px;\">nano \/usr\/local\/cpanel\/scripts\/securetmp<\/span><\/div>\n<\/blockquote>\n<\/div>\n<p>As default the size for tmp is 512 MB , just make it something that is convenient to you .<\/p>\n<p>In \/usr\/local\/cpanel\/scripts\/securetmp file, look for a line like this:<\/p>\n<div>\n<div><\/div>\n<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"9\">\n<tbody>\n<tr>\n<td>my $tmpdsksize = 512000; # Must be larger than 250000<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>and change it to<\/p>\n<div>\n<div><\/div>\n<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"9\">\n<tbody>\n<tr>\n<td>my $tmpdsksize = 2097152; # Must be larger than 250000<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>This will allow us to allot 2GB of space size for the tmp partition.<br \/>\nNow, you need to log in to SSH using root account to make the changes. Once you are in, run these commands one by one.<\/p>\n<div>\n<div><\/div>\n<blockquote>\n<pre dir=\"ltr\">umount -l \/tmp\numount -l \/var\/tmp\nrm -fv \/usr\/tmpDSK\n\/usr\/local\/cpanel\/scripts\/securetmp<\/pre>\n<\/blockquote>\n<\/div>\n<p>Then Restart the server :-<\/p>\n<div>\n<div><\/div>\n<blockquote>\n<pre dir=\"ltr\">shutdown -r 0<\/pre>\n<\/blockquote>\n<\/div>\n<p>Now when the server is fully restarted, you can check the partitions using the following command.<\/p>\n<div>\n<div><\/div>\n<blockquote>\n<pre dir=\"ltr\">df -h<\/pre>\n<\/blockquote>\n<\/div>\n<p><img decoding=\"async\" alt=\"\" src=\"http:\/\/i.imgur.com\/N3cGU.jpg\" border=\"0\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was frequently getting an error message that the \/var\/tmp directory in one of my cPanel CentOS 5.5 server is full and I need to delete some data. A cronjob is already there in crontab to cleanup the temporary data periodically, but I was still getting that error. I looked at the error log and [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[58],"tags":[81],"class_list":["post-158","post","type-post","status-publish","format-standard","hentry","category-cpanel-control-panel","tag-how-to-increase-size-of-vartmp-and-tmp-centos"],"acf":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/posts\/158","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/comments?post=158"}],"version-history":[{"count":0,"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/posts\/158\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/media?parent=158"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/categories?post=158"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/tags?post=158"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}