← Disk & Filesystem
Linux · Disk & Filesystem
How to find deleted files still held open in Linux
Recover disk space that df shows used but du cannot find, by locating deleted files still held open by a process with lsof.
When df shows a filesystem full but du finds nothing, a process is usually holding a deleted file open. The space is not freed until that process closes the file or restarts.
# Deleted files still held open (space not yet freed)
sudo lsof +L1
# Or filter the classic way
sudo lsof 2>/dev/null | grep deleted
# Which processes are using a mount point
sudo fuser -vm /var
# Free the space: restart or signal the owning process,
# or truncate its open descriptor:
# : > /proc/<pid>/fd/<fd>LinuxlsofDisk Space