cPanel/WHM Server. /var is 100% full

cPanel/WHM Server. /var is 100% full

 
I know with a couple of my older installs and some datacenter custom installs. /var is put onto its own partition. Often this partition is not big enough and you sometimes find your logs fulling up the partition to 100% disk space. In /var are the logs, mysql databases and queued email.

What I found out that filled my /var partition so much where the mysql databases. Get enough clients on a cPanel/WHM server and that partition is quickly filled up.

The quickest and easiest way to do this is to move those mysql databases to a partition with lots of spare disk space  This is normally found in /home. To do this you can type out the following commands

1) First we stop mysql:

# /etc/init.d/mysql stop

2) Now we create the directory we are going to be moving the databases to:
# mkdir /home/var_mysql

3) Now its time to move the databases to the directory you just created:
# mv /var/lib/mysql /home/var_mysql

4) After the databases have finished copying, we need to make sure mysql has permission to access the files we just moved:
# c hown -R mysql:mysql /home/var_mysql/mysql

5) Once the permissions are correct we need to make a symbolic link that links everything to the new file location:
# ln -s /home/var_mysql/mysql /var/lib/mysql

6) Thats about it. The only thing left to do now is startup mysql
# /e tc/init.d/mysql start

Everything should be working now and you should have a lot of spare space on your /var partition.

转载于:https://www.cnblogs.com/helloyb/archive/2013/03/16/2962512.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值