[mythtv-users] Two new physical drives appear as subdirectories of the same drive: why?
Michael T. Dean
mtdean at thirdcontact.com
Mon Mar 7 11:58:20 UTC 2022
On 03/06/2022 05:03 PM, UB40D via mythtv-users wrote:
>
>
> On Sun, 6 Mar 2022 at 00:33, Gary Buhrmaster wrote:
>
> On Sat, Mar 5, 2022 at 11:56 PM UB40D via mythtv-users wrote:
>
> > Thanks for this explanation but I find it mindboggling... Why
> does Myth need "heuristics" when perfectly reliable first-hand
> information is available from the computer and OS about which
> drive is which?
>
> Because some people choose to use different
> directories on the same drive, and therefore
> the amount of space available on the drive is
> not always a simple thing to calculate. Only
> when the available space is different does
> MythTV "guess" that they must be different
> drives (and calculates space as if they are
> different).
>
>
> I am not sure I understand the problem the programmers experienced
> when they wrote the code that way. It seems to me that there is no
> need for heuristics (= guesswork) when unequivocal information is
> readily available.
>
> for every directory d listed in mythtv setup as containing recordings:
> df -h $d will return something like
> FilesystemSizeUsed Avail Use% Mounted on
> /dev/sdd117T 16T294G99% /mnt/wd18000a1
>
> so it is trivial to figure out both
> a) how much free space is left on the drive that hosts that directory
> b) whether that directory is on the same filesystem or drive of any
> other directory (to avoid double-counting)
>
> I may be missing something crucial but I still fail to see why any
> guesswork might be needed.
>
And the heuristic needs to work across all platforms and needs to work
across all storage types, including network/distributed storage like
NFS, CIFS, ..., and needs to work even when there's block-level access
to a particular storage area from one MythTV backend and network access
to that same storage area from another backend. The approach that's
there generally works, and when it fails, it fails safely--doesn't
overstate the storage, meaning MythTV won't run out of storage space
during a recording due to not expiring recordings because there seemed
to be enough space available.
Mike
More information about the mythtv-users
mailing list