Errno 28 - resize /var partition?

Today I ran into a problem on one of my self-managed servers. Got a errno 28 aka out of space.

So on inspection of the drive (not all shown here):
/dev/md2 59G 8.1G 48G 15% /web
/dev/md1 9.7G 9.2G 25M 100% /var

From above I see I have only used 15% of /web, and 100% of /var where mysql and logs are located. I removed the logs (Hardly any), and took a look in mysql’s table sizes. Almost 9.G!

I do not think I can change the partition like this; but can I resize /web and give that to /var so mysql have more space without having to do something drastic as I’m working remotely?

If so, how?


Ps Im on CentOS

I assume it would depend on the filesystem you formatted these partitions with.

The easiest solution, though, is to move the database to /web.

All you have to do is stop MySQL, copy the data directory to a folder in /web, edit my.cnf to point there, and start MySQL again. With <10G should just take a few minutes, you can do it at night.

They are all ext3