Linux disk space is exhausted by unknown resources "Go"

Source: Internet
Author: User

Linux disk space is exhausted by unknown resources

In Linux, when we used RM to delete large files on Linux, but if a process opened the large file, but did not close the handle of the file, then the Linux kernel will not release the disk space of the file, resulting in disk space consumption of 100%, the entire system does not function properly. In this case, the disk space found by the DF and Du commands cannot be matched, the DF displays disk 100%, and the Du lookup directory has a small disk capacity.

In this case, it can be concluded that some large files are occupied by some programs, and these large files have been deleted, but the corresponding file handle is not closed by some programs, resulting in the kernel cannot reclaim the space occupied by these files.

So, how to find those files are occupied by some programs, the command is as follows

Lsof-n | grep deleted
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
DD 31708 Higkoo 1w REG 8,2 5523705856 429590/data/filetest (Deleted)

command to play Lsof-n | grep deleted prints out all read and write operations for deleted files, which are not valid and are the root cause of the inexplicable disappearance of disk space

Note: I encountered the scene is a colleague deleted the MySQL table, but the execution of the RM table on the shell file, rather than through the drop table and other commands to delete tables, so MySQL will always occupy the handle of these table files, resulting in disk space 100%, in this case, No need to restart MySQL, just go to the MySQL client and execute flush tables.

Reference HTTP://HI.BAIDU.COM/HIGKOO/ITEM/6A478917D1A819DEBF9042F1

Good text to the top has been concerned about the collection of this article

Linux disk space is exhausted by unknown resources "Go"

Related Article

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.