Disk full after deleting a log file? Find deleted but still-open files with lsof
Deleting a large file on Linux does not free disk space if a running process still holds it open, because the data is only released once no name and no process references it. This mismatch explains why df reports the space as used while du no longer sees the file. The article recommends comparing df and du, then using lsof +L1 or /proc to locate processes holding deleted files. Freeing the space usually means reloading or restarting the service, or truncating the file via its file descriptor as a temporary measure. Fixing the root cause often involves correcting log rotation so services reopen their logs or use copytruncate.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in