purplehead
Chevereto Member
I got an “out of space” error and my site could not be opened.
The error screen said the server had no space left. When I checked in the console using:
the main disk still had space, which matched cPanel. But then I checked inode usage with:
This showed the real issue: /tmp was at 100% inode usage. So the server was not out of normal disk space; it had run out of available file entries in the temporary filesystem.
MariaDB/MySQL was trying to create temporary SQL files in /tmp, but /tmp was a small separate/loop-mounted filesystem with too few inodes.
Fix:
I created a new MariaDB temp directory on the main disk:
This gave it the correct owner and restricted permissions:
Then I edited:
and added this under [mysqld]:
Then I rebooted the server and checked it worked with:
It worked! 15 minute panic over! 🙂
The error screen said the server had no space left. When I checked in the console using:
Code:
df -h
the main disk still had space, which matched cPanel. But then I checked inode usage with:
Code:
df -ih
This showed the real issue: /tmp was at 100% inode usage. So the server was not out of normal disk space; it had run out of available file entries in the temporary filesystem.
MariaDB/MySQL was trying to create temporary SQL files in /tmp, but /tmp was a small separate/loop-mounted filesystem with too few inodes.
Fix:
I created a new MariaDB temp directory on the main disk:
Code:
mkdir -p /var/lib/mysqltmp
chown mysql:mysql /var/lib/mysqltmp
chmod 750 /var/lib/mysqltmp
This gave it the correct owner and restricted permissions:
Code:
drwxr-x--- 2 mysql mysql ... /var/lib/mysqltmp
Then I edited:
Code:
/etc/my.cnf
and added this under [mysqld]:
Code:
tmpdir=/var/lib/mysqltmp
Then I rebooted the server and checked it worked with:
Code:
mysql -e "SHOW VARIABLES LIKE 'tmpdir';"
df -ih /tmp
It worked! 15 minute panic over! 🙂