Notice: For this entire post, I assume /dev/sda3 is your new drives partition. If you don't know the location of your new drive or its partitions, you can use fdisk to figure it out:
Originally Posted by Neil948
First of all, you need to prepare the new drive. This is a pretty simple task, and you can easily do it if you follow this guide: https://help.ubuntu.com/community/In...gANewHardDrive
If you have already finished the partitioning of the drive, you can easily format the partition with a simple command:
Secondly, you will need to modify your fstab to reflect the changes you wish to make.
sudo mkfs -t ext3 /dev/sda3
Replace your current fstab entry for /tmp with something like the following example:
sudo nano /etc/fstab
That will set the /tmp mount point to reflect /dev/sda3, assumes you're using the ext3 filesystem, and mounts with the options of noexec and nosuid. You simply modify this example based on what filesystem you're actually using, and other arguments that might be specific to your situation.
[Device] [Mount Point] [File System Type] [Options] [Dump] [Pass]
/dev/sda3 /tmp ext3 noexec,nosuid 0 2
Also, if you're happy with where /tmp is currently living and decide not to use the second drive for this purpose, you can just replace the defaults keyword under options to noexec,nosuid to achieve the same effect without using your new drive to house the /tmp partition.
The next time you mount the filesystem, it will be using those options. You could easily do this by issuing a remount command, and avoid having to reboot the server.
That should remount /tmp using /dev/sda3 as its new location, and it will be using the noexec and nosuid options that you need. If it does not remount /tmp then you can use the following command to help you diagnose the problem:
sudo mount -o remount /tmp
For more information: https://help.ubuntu.com/community/Fstab
sudo cat /proc/mounts