How to increase tmp partition size

How to increase tmp partition size

How to increase /tmp partition size

Most linux servers have a separate /tmp partition to prevent from filling up the root directory with temporary files. Temp partition has a fixed size but occasionally it can get overfilled, so no new information can be recorded. If this happens one can clear out /tmp periodically using some cron job, reconfigure application to store temporary files in some other directory or increase temp partition.
To increase /tmp it is necessary to create a virtual partition and mount it.

To do this on a VPS.net server with cPanel/WHM installed please follow the steps here:

http://wiki.vps.net/cloud-servers/cpanel/increase-tmp-partition-in-cpanel-and-secure-it/

To do this on a VPS.net server without cPanel let’s go through the following steps:

Stop Apache and MySQL services.

 

# /etc/init.d/httpd stop; /etc/init.d/mysql stop

 

Take a backup of /tmp

 

# cp -rp /tmp /tmp.bak

 

Create a partition of 2GB using the below command

 

# dd if=/dev/zero of=/usr/temp-disk bs=2M count=1024

 

Create the file system on it using the mke2fs command

 

# mke2fs -j /usr/temp-disk

 

Unmount the current /tmp partition

 

# umount /tmp

 

Mount the new /tmp filesystem using the below command

 

# mount -t ext3 -o rw,noexec,nosuid,loop /usr/temp-disk /tmp

 

Set the correct permission for /tmp

 

# chmod 1777 /tmp

 

To verify the partition, execute:

 

# mount

 

Restore the content of old /tmp.bkp directory

 

# cp -rp /tmp.bak/* /tmp

 

Start Apache and MySQL services.

 

# /etc/init.d/httpd start; /etc/init.d/mysql start

 

To make sure this partition is mounted automatically after every reboot, edit the /etc/fstab and replace /tmp entry line with the following one.

 

/usr/temp-disk /tmp ext3 rw,noexec,nosuid,loop 0 0

 

Here it is, the /tmp partition size has been increased. If any issues occur while doing this please do not hesitate and contact our support team.

    • Related Articles

    • Cloud Compute Quota

      On the cloud compute platform, the current Quota limit for brand new customers is 10 virtual machines (max 500 GB Memory). To request for more quota, you will need to have qualified by doing the following: Account owner has 2 months of successful ...
    • Rsync Backup and Restore Instructions

      Rsync Backup/Restore Instructions Category: Miscellaneous &nbsp Detailed Rsync backup instructions are available To begin, simply log in as root to your server using: shell access method (VPS Console, SSH, telnet, etc.) or control panel (Cpanel, ...
    • Install ConfigServer Firewall On A cPanel Server

      ConfigServer Firewall (CSF) is a popular Linux firewall security suite. It is easy to install, flexible to configure and secure with extra checks. CSF helps control exactly how much traffic is allowed in and out of the server to protect the server ...
    • How To Store InnoDB Data In One File Per Table

      To achieve faster performance of MySQL server with InnoDB engine and for I/O optimization one can choose file-per-table mode. InnoDB storage engine stores all data for tables in a common tablespace. It is possible to configure InnoDB to store data ...
    • Prioritising Processes With Nice and Renice

      Prioritising Processes With Nice and Renice Category: Getting Started &nbsp Processes on a system all have a priority assigned to them which is referred to as it’s niceness. This is a concept that harks back to shared user systems where the priority ...