I just wanted to share this with anyone that may be experiencing the same or a similar issue as myself.
The problem was that my recordings were disappearing from my TVH client's 'Recordings' list in Kodi whenever I rebooted the box that is running my tvheadend server.
However the recording files still existed on the drive in my 'Recorded TV' folder and they would play if directly opened in VLC player, but TVHeadend had lost track of them somehow.
I thought it was a corruption of some recording database or other. The missing recordings were all listed in the PVR 'Removed Recordings' tab of the TVH configurator.
The reason given was 'File Missing'. Odd, since the files were obviously where they should be.
In my case the server is an Ubuntu box but this solution can apply to other setups.
The root cause turned out to be a boot timing issue. The TVHeadend service was already started before the drive with my TV recordings had mounted.
TVH couldn't see my recordings when it started because of this, and it assumed that they had been deleted (or whatever). Additionally, TVH server doesn't seem to rectify this situation even after the drive has mounted, and so the recordings would never reappear. I eventually figured this out as a result of realising that issuing "sudo service tvheadend restart" in a terminal window would cause the Recordings to reappear where they should be, in 'Finished Recordings' and therefore also in Kodi.
The solution is to somehow delay the tvheadend service from starting, until the drive with my TV recordings is mounted. In my case, this was a separate internal drive dedicated solely to TV Recordings (and the TV buffer).
It happened to be formatted under windows as NTFS, but this shouldn't affect things, although it may explain why mounting is a little slow.
The mounting of drives and starting of services, is managed as 'units' by systemd. This is useful, because the sequence of these events can be managed under one umbrella.
To prevent the tvheadend service from starting before a specific drive has mounted, you need to edit the tvheadend.service unit override configuration using systemctl.
To do this, open an interactive session (a root session) in terminal.
# systemctl edit tvheadend.service
(The hash symbol above is the root prompt, you don't type that bit). An editor will open with an empty configuration file.
It will be named something like /etc/systemd/system/tvheadend.service.d/.#override.confbe8889bcd33b05d2
You should copy the following 2 lines into the file:
Then press 'Ctrl' + 'O' followed by 'Ctrl' + 'X' to save the changes and exit the editor.
In my case the path to my recordings is '/mnt/Multimedia/Recorded TV" Where 'Multimedia' is the drive we want to check for mounting. You can adapt this line for your own setup.
Note: The path should point to thedrive and not a folder or sub-folder on it.
You can adapt this general idea to delay the starting of the tvheadend service until other dependencies are available, such as other services, mounts or devices.
Hope this helps someone!