No space left on Device

Source: Internet
Author: User

 

When implementing the "stepping board" problemProgramWhen an error occurs, write files repeatedly to exhaust hard disk space.

# DF

/Dev/sdc1 20799540 19751436 0 100%/home/sluo

No matter how the file is deleted, the remaining space is 0, and it is not increased. Many people on the internet encounter hard disks with space, but the error "no space left on device" is also reported. Apparently, the problem is that inode is exhausted. To create a file on Linux, the corresponding inode is required. If inode is exhausted, the file cannot be written. inode can be viewed through DF-I. Generally, because there are too many <2 k small files, and each small file occupies an inode, there will be still space on the hard disk, but it cannot be written. I encountered the opposite problem. Normally, this is correct. There is no space for the hard disk, but there is still room for inode. However, my problem is that the disk space is not increased when files are deleted. I have encountered this problem before and I don't know how to solve it. Today is not so lucky, so we can only try to find the real reason. In fact, the answer is simple: In Linux, if a process enables file read/write, as long as the process does not exit, the file will not be deleted even if the file is deleted.Through lsof-S, I can see that the file written by my previous program is still (although there are annotations (Deleted), so through, PS-Aux | grep mage finds the process and kill it. At this time, the hard disk space is increased by 1.1, indicating that the process is exited and the hard disk space is being released. Thanks to this post, the key is the first greeblesnort reply http://serverfault.com/questions/73051/no-space-left-on-device-df-shows-discrepancy.

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.