FIX: Deleted file space is not released

Source: Internet
Author: User

More strange, today with the RM command to delete a large file on the server, DF view hard disk space is not released, after looking for information, summary:

The RM Delete file is unlinked from the directory structure of the file, and if the file is being read and written by the program, such as the httpd service, then the HTTPD service can still read and write the file, causing no space to be released.

We need to find the file first:

ls -lhtr

To find the process that is using the file:

grep trace-file

Find process-related information based on process number

PS grep 2567

Then empty the file you are reading and writing:

When the file is being read and written, deleting the file directly causes the hard disk space to be freed and the user cannot re-access the file, which can only be resumed by a service restart. Large files can be emptied in the case of file inode retention.

 [[email protected] ~]# ls -L trace- File -rw-r--r--1  root root 111840  Jan 13  09 : 27  trace-file  [[email protected]  ~]# echo  > Trace-file   [[email protected]  ~]# ls -L trace-file -rw-r--r--1  root root 1  Apr 9  13 : 29  trace-file  

FIX: Deleted file space is not released

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.