I recently updated an ubuntu 14 box to version 16.04. Everything appeared to go smoothly, however now I am unable to create any new mysql tables.
I'm signed into the ubuntu box as root and mysql as the root user. The error I receive when trying to create any table is:
ERROR 1005 (HY000): Can't create table 'foo' (errno: 122)
I've done some investigation and I'm lead to believe this is a disk quota error. As much as I understand mysql and some basic webserver bits, I'm not an expert in general ubuntu administration. I've run quota
and it returns
Disk quotas for user root (uid 0): none
Is anyone able to advise what I need to do here to fix this? Thanks
Based on a comment I checked my syslog and I see
../../../../lib/isc/unix/file.c:347: unexpected error:
unable to convert errno to isc_result: 122: Disk quota exceeded
dumping master file: tmp-jaCquXzkj6: open: unexpected error
CRON[32105]: (CRON) error (create tmpfile)
CRON[32104]: (CRON) error (create tmpfile)
update this happened even when creating a simple table such as
create table foo(id int);
But I've also noticed I get a quota error just trying to create a dir e.g
mkdir test
mkdir: cannot create directory 'test': Disk quota exceeded
I ran the df
command and I get the following output
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/vzfs 50000000 6390516 43609484 13% /
devtmpfs 1048576 0 1048576 0% /dev
tmpfs 1048576 0 1048576 0% /dev/shm
tmpfs 1048576 102008 946568 10% /run
tmpfs 5120 0 5120 0% /run/lock
tmpfs 1048576 0 1048576 0% /sys/fs/cgroup
none 1048576 0 1048576 0% /run/shm
tmpfs 209716 0 209716 0% /run/user/0
df -hi shows
df -hi
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/vzfs 245K 245K 0 100% /
devtmpfs 256K 56 256K 1% /dev
tmpfs 256K 1 256K 1% /dev/shm
tmpfs 256K 411 256K 1% /run
tmpfs 256K 7 256K 1% /run/lock
tmpfs 256K 10 256K 1% /sys/fs/cgroup
none 256K 1 256K 1% /run/shm
tmpfs 256K 4 256K 1% /run/user/0
and quota -v
Disk quotas for user root (uid 0):
Filesystem blocks quota limit grace files quota limit grace
/dev/vzfs 5781580 0 0 218669 0 0
I then deleted one tar.gz file and now df -i
shows
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/vzfs 18446744069926773888 18446744069414834326 511939562 100% /
devtmpfs 262144 56 262088 1% /dev
tmpfs 262144 1 262143 1% /dev/shm
tmpfs 262144 410 261734 1% /run
tmpfs 262144 7 262137 1% /run/lock
tmpfs 262144 10 262134 1% /sys/fs/cgroup
none 262144 1 262143 1% /run/shm
tmpfs 262144 4 262140 1% /run/user/0
Can anyone explain what's going on and how can I fix this. The machine has plenty of space left, but for some reason the quota is full and I don't know enough about inodes to know how to resolve this and stop myself from hitting this error in the future (physical disk space permitting)
* EDIT 2 *
Ok so after digging around I've managed to find this command du --inodes -d 3 / | sort -n | tail
which shows the following results
13136 /usr/lib
20145 /proc
26549 /usr/local/lib
29989 /usr/share
30239 /usr/local
78892 /usr
127929 /var/log/samba
128235 /var/log
145269 /var
259479 /
samba seems to be using a lot of space, but does anything else look out of the ordinary? I've removed a large number of node websites where node_modules where obviously using a fair amount of space but it's still not enough. I'm wondering if the update has resulted in a lot of redundant old packages, though apt-get remove hasn't cleared too much up.
I've changed my samba log rotation from weekly to daily so hopefully that will help
0 Answers