Centos /root/core.* files? they eat the hard disk till it is full

core-dump

I have a vps server with 130GB hard disk. Recently, the server is crash down, I access ssh and use dh -h,

Filesystem            Size  Used Avail Use% Mounted on
/dev/vzfs             130G  130G   0  99% /
none                  2.0G  4.0K  2.0G   1% /dev

Then use du -sh /* I find root fold with 59GB. then du -sh /root/*, a long list with some file like

...
43M     /root/core.7856
59M     /root/core.7859
59M     /root/core.7862
43M     /root/core.7883
43M     /root/core.7885
43M     /root/core.7889
59M     /root/core.7892
59M     /root/core.7904
43M     /root/core.7906
59M     /root/core.7913
43M     /root/core.7915
59M     /root/core.7940
59M     /root/core.7942
43M     /root/core.7947
43M     /root/core.7951
...

I access my server with fileZilla, 1204 core.* files create in recent 3 days.

So what is centos /root/core.* files? How are they created? Could I delete them without damage my server? And how to avoid them to be created again?

FIX THE PROBLEM

The problem caused by linux mail system. I changed /etc/mail/trusted-users permission in etc/mail/submit.cf line 552. then, no /root/core.* files be created again.

Best Answer

These are so-called core dumps. Some signals' default handler besides killing the receiver of the signal is writing out the memory contents and process state at the time of death for post-mortem analysis. Unless you're planning to dissect those files you can safely remove them.

You could also inhibit the creation of core dumps by setting the appropriate resource limit to 0 (this is done by setting the core item in /etc/security/limits.conf to 0).

You should note that the fact that your system creates those files rather rapidly should alarm you that there's something not going too well because some process regularly dies in a non-intended way. This could be caused by a buggy (automatically respawning) program or be caused by more serious problems like memory defect. You might want to look into your log files and dmesg output to get a hold on that.