Why Disk Space Stays Full After Deleting a Large Log File on Linux
A server ran out of disk space even after its largest log file was deleted, because df still showed the filesystem as full. On Linux, removing a file only drops its directory name, and the storage is freed only once no names and no running processes still reference it. An application that had the log open keeps its descriptor valid, so the data continues to occupy space and may even grow. Tools behave differently here: du cannot see unlinked files, while df counts allocated blocks, and lsof +L1 can reveal which process is holding the deleted file. The recommended fix is to have that application reopen or reload its log, or restart the service, with truncating via /proc only as a risky emergency option.
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