Recover lost disk space on Linux

Source: Internet
Author: User

The most recent server space is always an alarm and there is not enough disk space.

Using the DF command, disk space is close to 100%, the stale data on the machine and the logs are cleaned up, but the space is soon approaching 100%.

Using Du view, want to find out where the disk space is spent, the results found that his output and DF command output difference is very large, away from the 100% space occupied is still far away.

Where's The lost space, is the disk damaged?

Search by Google and discover two possible causes:

1. After the disk file is deleted, but the original corresponding to the process of writing the file is still, grasping the file, in the inside to write the data, the space continues to be consumed by him, while the deleted space is not released, du command can not see the space occupied by the file.

2. Use the mount command to mount to a directory that has data, and the files in the previous directory are not visible and are not counted by DU.

Because this server does not have a special directory mount, follow question 1 to find the lost space.

Using Lsof | grep deleted find the deleted file and sure enough to find a huge log file

Kill the process of writing this log file outside, found that disk space 1.1 points were released back

Rerun the process and the discovery log is also written correctly.

Recover lost disk space on Linux

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.