Friday, February 24, 2017

Remove Old Kernels on CentOS 7 (clean /boot partition warning WHM)

As we know kernels use to update regularly in linux server and blocking storage of old kernel files. So we use to get mail notice like this blew on when we use WHM in server.

The filesystem “/boot” mounted at “/boot” reached “warn” status because you currently use 84.36% of its available blocks.

First, check what kernel we're using, and do not attempt to remove it using following command


# uname -a

We'll get current kernel version which we must not delete like blew
3.10.0-514.6.2.el7.x86_64
Check Installed Kernels use following command we'll get list of kernel 


rpm -q kernel
kernel-3.10.0-229.el7.x86_64
kernel-3.10.0-327.28.2.el7.x86_64
kernel-3.10.0-514.6.2.el7.x86_64

Normally reason why you maybe want remove kernels is limited disk space, example on VPS servers and laptop. This is very easy task, you need yum-utils package.
yum install yum-utils
If you want to update latest kernel run following command from SSH using putty

yum update
Package-cleanup set count as how many old kernels you want left
example if there are 5 kernels and we want to keep 2 and remove other old kernels use following command
package-cleanup --oldkernels --count=2

Wednesday, February 15, 2017

Duplicate entry '1' for key 'PRIMARY'

My application is working fine in localhost but when i was export my sql file online server suddenly it is showing

Duplicate entry '1' for key 'PRIMARY'

I drop the table and again import server times but no solution though i'm sure i have a primary column with auto increment option.

So later when exporting the sql file from phpmyadmin i click "custom", scoll down and click Add DROP TABLE / TRIGGER statement. then import the sql file again and this  time it worked for me.



Total Pageviews