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

Simon Hobson linux at thehobsons.co.uk
Thu May 14 06:54:27 UTC 2009


David Whyte wrote:

>I was looking at creating a cron job that will run every 30mins or so,
>that will run a script to simply move files from a somewhat full disk
>to one that has space or has plenty of deleted recordings.  I will use
>the myth python bindings to prevent me moving files that are currently
>being recorded to.  The only problem I see is that someone may start
>watching the same recording I am moving during the time it takes to
>actually do a filesystem move.

That may not be a problem.

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.

I found this handy when I had to restore stuff - it was often easier 
to restore a whole directory (perhaps 10G) off tape than to specify 
exactly the files we wanted. Since space was limited at times, I then 
had to delete the files I didn't want while the restore was in 
progress to avoid the filesystem filling up.

So what I would expect to happen is that your script would move the 
file, it would be appear to be deleted, but the space would still be 
in use. Once viewing is complete and the file is closed, the space 
will appear.

-- 
Simon Hobson

Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed
author Gladys Hobson. Novels - poetry - short stories - ideal as
Christmas stocking fillers. Some available as e-books.


More information about the mythtv-users mailing list