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.