DF and du disk space are inconsistent

Source: Internet
Author: User
Background

Recently deployed a set of services on the server, the service is not careful to run the log file to delete, testing the service does not affect the normal operation, and no log processing operations will not be complacent throw that, but inadvertently also buried a huge pit. Received the server disk when the alarm on DF looked full, but du-h look at the time found only a total of 130G of the disk used 20G less than. problem

Df-h: Disk space is full
Du-h: The disk occupies only 20G not to cause (Baidu)

Du-h
The DU-SH command adds total blocks and total sizes by adding up the number of blocks used by all directories, symbolic links, and files under the specified file system path. It will traverse this directory, for all the real existence of files, directories and other summaries, give the final results

Df-h
First, get the file handle for this file, which will determine if the file exists.
Then, all writes to the program use only file handles, and no longer focus on the existence of the specific file. Linux allows deletion of a file being written to RM or mobile MV. The application gets the handle, points directly to the disk location, writes to the level of the block, and no longer checks for the existence of the file the data block belongs to. This time the write, for other people, because access to the portal-file-does not exist, so is not see its written content. Solution

Lsof-n | grep deleted

Locate the open but deleted file, and then find the service that uses this file to reboot. It's time to use df-h to see if the disk space is normal.

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.