Issue with "add index" showing "cannot get disk capacity at /tmp/tidb/tmp_ddl-4000: no such file or directory"

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 关于add index出现“ cannot get disk capacity at /tmp/tidb/tmp_ddl-4000: no such file or directory”的问题

| username: 泰迪比爱好者

I saw suggestions on the forum to create a new /tmp directory, and some suggested modifying the tmp directory. So how should the tmp directory be modified?

| username: tidb菜鸟一只 | Original post link

After creating the /tmp/tidb/tmp_ddl-4000 directory, just grant permissions to the tidb user.

| username: WalterWj | Original post link

The fast DDL issue requires specifying a path. By default, it is in the tmp directory. If this directory does not exist, you can manually create it using the tidb user.

| username: 泰迪比爱好者 | Original post link

I want to specify that path to a custom path of mine, how should I do it?

| username: tidb菜鸟一只 | Original post link

Setting the temp-dir parameter for TiDB, the default is /tmp/tidb.

| username: 大飞哥online | Original post link

You need to manually create the /tmp/tidb/tmp_ddl-4000 directory and then use chown tidb:tidb -R to grant permissions.

| username: TiDB_C罗 | Original post link

I’ve deployed dozens of times and have never encountered this issue. I often see this problem in the forum. Is there some configuration for it?

| username: ajin0514 | Original post link

Manually create the /tmp/tidb/tmp_ddl-4000 directory.