[mythtv-users] Storage Groups - Disks often get over used when others have free space

David Brodbeck gull at gull.us
Thu May 14 16:42:38 UTC 2009


Simon Hobson wrote:
> If someone starts watching a recording, then they'll cause the file to 
> be open when it's deleted at the end of the move. I have to admit that I 
> hadn't actually tried this in Linux, but on "another brand" I used to 
> work with regularly, you could delete a large file that was open and it 
> would disappear from the filesystem - then once the file was closed the 
> space would magically appear as the underlying inode was deleted. Just 
> tried it now on a Debian Lenny system and it does in fact work the same.

This is normal behavior on Unix-like systems.  If you delete an open 
file, the directory entry disappears, but the actual file stays around 
until it's closed.

Some software will actually take advantage of this when handling 
temporary files, by opening the temporary file and then immediately 
unlinking (deleting) it.  The file handle stays valid and the file can 
still be read or written to, but when the program closes the file handle 
the data is automatically cleaned up by the filesystem.  This saves 
having to do a separate unlink step (which can cause race conditions, 
and may not happen if the program ends abnormally) and also hides the 
file from other programs.



More information about the mythtv-users mailing list