Deleted Open Files Keep Disk Space Until the Writing Process Exits
A cleanup that removes camera clips can leave disk usage unchanged if a process still holds one of the files open. On Linux, removing a name does not release the space while a file descriptor remains open. In tests on ext4 using a stand-in recorder, a deleted 200 MiB file kept its space allocated until the writing process exited. The author found the process with lsof and /proc, and noted that truncating the file through /proc freed space but left the writer with a sparse file. The behavior matches the unlink(2) documentation, which keeps the file in existence until the last descriptor closes.
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