Linux Server disk full problem resolution

Source: Internet
Author: User

After work today, an e-commerce technical department leader found a problem, said their server hard disk full. The log files are deleted, but the hard disk space is still full. The df-h then looked at the status of each mount point (for example).

650) this.width=650; "border=" 1 "alt=" Linux Server disk full problem solving triple "src=" http://img13.3lian.com/201312/14/ 95b6d3b380d7548659d3814efda03b4c.jpg "width=" 387 "height=" 124 "style=" margin:0px;padding:1px;border:1px solid RGB ( 204,204,204); "/>

/dev/sda3 occupies 100%, then we du-s H./* To see the usage of the directory (for example).

Linux disk mount point directory usage (figure)

The sum of the directories under the mount point is far less than 4.5G, so what takes up the hard drive?

The answers to this question are as follows:

When the Apache/tomcat service is running, the log that runs the service is emptied, causing the problem of/dev/sda3 to be full. In general, most services, including scripts, cannot delete log files that are currently being written at run time.

Principle Analysis:

1. The current Access.log log is being consumed by the Apache process.

2. Delete Access.log via RM command, only the file name is actually deleted (the log file is not 0, so the space is not freed).

3. After removing Access.log through RM command, Apache still writes log to Access.log, when the Apache process is turned on, it has been positioned to the inode of the file through Access.log, that is, the log is not passed access.log, so even if the access is deleted . Log,apache still writes logs to the Inode node where the access.log resides, resulting in increased disk space.

4. Because the deletion of the access.log, so we can not find the file, Du also can not be found, the hard disk will be full but can not see exactly what files occupy.

(Write not very detailed, do not understand the people again under Google.) )

Workaround:

Restart the log file related services or programs, such as: for Apache log file restart Apache (for example, after restarting the hard disk space consumption is normal).

650) this.width=650; "border=" 1 "alt=" disk occupied back to normal (figure) "Src=" http://img13.3lian.com/201312/14/ 5bbf83f017c7412b4a9b5c721ff0c988.jpg "width=" 425 "height=" "style=" margin:0px;padding:1px;border:1px solid RGB ( 204,204,204); "/>


Linux Server disk full problem resolution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.