Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an Amazon EC2 instance which has given me a tiny '/' partition and a large '/mnt' partition. As such, I have moved my mysql data-dir over to the /mnt partition. However I am now having issues with the /tmp folder running out of space on my massive join queries and am trying to also move /tmp to /mnt/tmp. I tried to do this with a symlink but that results in the mysql service being unable to start.

Please advise on how to move the storage of /tmp over to /mnt (/dev/xvdb)

share|improve this question
up vote 5 down vote accepted

You can bind the /tmp mount point to /mnt/tmp:

sudo mount -B /tmp /mnt/tmp
share|improve this answer
Fantastic! easy once you know how. – Programster Nov 5 '13 at 18:01
One thing you have to be very aware of is that the /mnt partition is ephemeral storage. If you stop your instance (or it degrades and AWS moves it), the data in /mnt will be lost. It is recommended (especially for your MySQL) to mount an EBS volume, and use that for data you want to be persistent. – Kevin Willock Nov 5 '13 at 23:37
@KevinWillock I think that his /mnt (by the size) is persistent (or he mounted something there which is persistent) since he is actually saving data there. BTW, you may actually want to ping him (using @) since I'm almost sure didn't got pinged. – Braiam Nov 5 '13 at 23:45
@Braiam I didn't get pinged but checked this thread again by luck. Kevin would be correct that this is ephemeral storage. I know that this is highly unsafe but was done deliberately for testing performance of using local storage. If I was to use such a system, I would be making sure to replicate to an EBS volume or RDS itself and backing up from there. I am well aware of the risks. – Programster Nov 7 '13 at 11:48
Do I need to execute that command on every reboot? – hithwen Apr 21 '14 at 14:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.