# Ubuntu 18 and tmpdir

**URL:** <https://forums.percona.com/t/ubuntu-18-and-tmpdir/9853>\
**Category:** Percona XtraDB Cluster 5.x\
**Created:** [March 27, 2021, 9:11pm UTC](https://forums.percona.com/t/ubuntu-18-and-tmpdir/9853 "2021-03-27T21:11:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcoshaw](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/marcoshaw/32/1346_2.png) [@marcoshaw](https://forums.percona.com/u/marcoshaw)\
**Post date:** [March 27, 2021, 9:11pm UTC](https://forums.percona.com/t/ubuntu-18-and-tmpdir/9853/1 "2021-03-27T21:11:37Z")

</div>

**2nd hand info from my DBA, I’m more of an OS guy**

While testing, we added an index to a large table: ALTER TABLE … ADD INDEX …

We eventually received the error:  
Error Code: 1878. Temporary file write failure. 474.219 sec

My DBA pointed the tmpdir to another location for testing purposes and it was fine.

I’m running Ubuntu 18, and what I’ve gathered so far just resizing /tmp (it’s currently only 1GB - this is just a generalized VM template I use) is not the solution and I need to read up on tmpfs. It appears it might default to half of the RAM assigned to the server (virtual machine).

So does it make sense that I’ll just update /etc/fstab and set /dev/shm to be hardcoded with “size=64G”?

---

<div class="post-metadata">

**Author:** ![przemek](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/przemek/32/3_2.png) [@przemek](https://forums.percona.com/u/przemek)\
**Post date:** [March 28, 2021, 11:19pm UTC](https://forums.percona.com/t/ubuntu-18-and-tmpdir/9853/2 "2021-03-28T23:19:52Z")

</div>

Indeed long alters may demand lot of intermediate disk space. This is described here:  
[https://dev.mysql.com/doc/refman/8.0/en/innodb-online-ddl-space-requirements.html](https://dev.mysql.com/doc/refman/8.0/en/innodb-online-ddl-space-requirements.html)  
and  
[https://dev.mysql.com/doc/refman/8.0/en/temporary-files.html](https://dev.mysql.com/doc/refman/8.0/en/temporary-files.html)  
Assigning 64G of RAM for tmpfs seems like an overkill, MySQL should be able to utilize free memory much better in InnoDB Buffer Pool, while usually tmpdir pointed to big enough disk partition works just fine.
