Linux disk occupancy reaches 100%, solutions and methods

Error when starting projects and software under Linux: ERROR: SQLSTATE[HY000] [2002] Connection refused in 

This error was reported after starting ZenTao under Linux, and then it was found that the disk was full, causing MySQL to fail to start.

Solution:

1. First  check the disk status with df -h

df -h

It was found that the disk usage Use%- reached 100%. No wonder we got an error when we started the project.

2. Then we need to locate what causes such a high share.

In the root directory, use the du -sh /* | sort -nr command to find the sorting results of the sizes of all files and directories in the / directory.

du -sh /* | sort -nr 

3. At this time, we can locate the problem caused by our /usr file.

Then we still need to find the real reason for our high disk usage step by step. We can’t just kill the entire file. That’s not reasonable!

So we can continue to use the du -sh /usr/* | sort -nr command to enter the /usr file and locate it:

du -sh /usr/* | sort -nr

4. Finally, it was found that our tomcat’s catalina.out log file recorded too many logs.

       Then we can use command    > file name    or c at /dev/null > file name    to clear the file but not delete it.

#catalina.out 文件名
>catalina.out  
#或者 
cat /dev/null > catalina.out

At this point, our problem of disk occupancy reaching 100% has been completely solved. Just restart the service or project and it will start normally!

Like to follow! ! Like, like, like, say important things three times! ! !

Guess you like

Origin blog.csdn.net/sl1057/article/details/131116293