On a Linux server /tmp partition was only 1 GB, it gets full at times, no matter how many times it gets cleaned automatically with tmpwatch.
The server had the following in its /etc/fstab file:
[root@server1 ~]# cat /etc/fstab
UUID=c0f46bb1-c0bc-4199-95d6-551d03c12a0a / xfs defaults 1 1
/var/.tempdisk /tmp ext4 loop,rw,noexec,nosuid,nodev,nofail 0 0
/tmp /var/tmp none bind 0 0
[root@server1 ~]#
As you can see currently file /var/.tempdisk is mounted as /tmp.
So I created a new file with a 4 GB size
dd if=/dev/zero of=/var/sok_tmp bs=1M count=4096
Format it as an ext4 file system
mkfs -t ext4 /var/sok_tmp
Before I switch /tmp to the newly created disk, I need to copy the content of the current /tmp to it. For this, I mount the new disk as /tmp2
mkdir /tmp2
mount -o loop /var/sok_tmp /tmp2
rsync -avzP /tmp/ /tmp2/
Now you have all files of /tmp in /tmp2, edit /etc/fstab
nano /etc/fstab
Find the entry for the current /tmp partition
/var/.tempdisk /tmp ext4 loop,rw,noexec,nosuid,nodev,nofail 0 0
Replace it with the new file you created
/var/sok_tmp /tmp ext4 loop,rw,noexec,nosuid,nodev,nofail 0 0
Reboot the server. You will have a 4 GB /tmp partition now.