TVheadend problems after new update - lose list of recordings

I’m beginning to suspect a faulty SD card, although the symptoms don’t quite fit.

@pab11 are you able to write a file to the card (say use nano to create a text file in your home directory), re-boot and it’s still there?

@grahamh yes - no problem doing that.
is there a way to check for a faulty sd card? i know i could use the tools in windows explorer to check for this with a regular SD card, but b/c this is a linux system on the card, it might say that it is faulty just b/c of that.
any other suggestions?
thank you

See this post here Can't update OSMC or change kodi settings - #8 by JimKnopf

So, idea is to save the image of the SD card (if readable at all), reformat the SD card, test the card and in case of no issues at all, burn back the previous saved image.

Second thoughts - we have a theory, now.

Can you unplug the My Passport, re-boot, and then tell us the output of ls -lh /media?

i just finished doing what Jim suggested. No errors. Now i’m putting the image back on the SD card.
I may not get to @grahamh suggestion soon b/c the image is still writing and i’m going to see the new avengers movie - woo hoo!, but will give it a try when back.
thanks everyone for your help on this! even if it turns up empty, i still appreciate your time very much.

2 Likes

Here’s the output of ls -lh /media when the My Passport hard drive is not installed and I’ve rebooted.
http://paste.osmc.io/upeyejoran.hs
Hope this helps!

OK, so is there anything in My Passport when the disk isn’t there?

ls -lh /media/My\ Passport

If that shows a directory PVR then have a look to see if there are any recordings in there.

ls -lh /media/My\ Passport/PVR

If that lists some files, (I’m guessing that’s where your two rogue recordings are) move them somewhere safe then delete the My\ Passport directory, as follows. With the drive still unplugged:

mkdir /home/osmc/tmp/
mv /media/My\ Passport/PVR/* /home/osmc/tmp
sudo rm -r /media/My\ Passport

Now plug in the drive and that should automatically create a new directory in /media/. Hopefully, it will be called My Passport.

mv /home/osmc/tmp/* /media/My\ Passport/PVR/

reboot and see what you get.

Unfortunately, when the drive is not plugged in, ls -lh /media/My\ Passport returns “No such file or directory”.

One more interesting item. As noted above, when i restart, the list of recordings is empty. in the tvheadend browser, they show as “File Missing” under “Removed Recordings.”. Now, if i don’t do the tvheadend restart command, any recording that i make subsequent to the restart will be listed in the recordings. So again, after restarting the Pi, and without a restart of Tvheadend, any recording that I make will be listed. However, once I restart the Pi again, the list of recordings will be empty.

I’m beginning to think that perhaps @bmillham is right - the TVheadend service is starting before the drives are mounting, b/c anything that happens after the drive is mounted seems to works properly and the “file missing” makes me think that the drive isn’t available to TVheadend yet.

Let me know if this helps. Hopefully it might aid in providing another suggestion. Thank you.

I tried something here that seems to have solved the problem.
Given @bmillham suggestion, I tried to figure out how to delay a service at startup.
I went into the /lib/systemd/system folder
then “sudo nano tvheadend.service”
then right under [Service], I added the following
“ExecStartPre=/bin/sleep/ 30”

this has fixed the problem! interesting to note that this same command was listed below but for only 10 seconds (3rd line below [Service]).

Anyway, i know this is a bit of a workaround but i’m glad this is solved (assuming there are no other issues that pop up now b/c of this).

thank you everyone for your help and time on this issue. Much appreciated.

Glad you found a fix. Meanwhile I was drafting this.

It seems the My Passport drive is the last of the five (!) drives to get mounted, and it’s happening after the pvr has looked for TV recordings. I thought maybe you had a ‘sticky’ directory at /media/My\ Passport which was messing things up but you do not.

You are accessing your local drives My Book, Seagate2, easystore and easystore2 via SMB. This is not necessary and could be slowing things up. I don’t use MySQL but I think it would be better to use the local drive names and use path substitution in the other devices that need to access the MySQL database.

@grahamh - thank you so much for your help here. I appreciate it.
Your comments regarding Samba and how I access my local drives intrigues me. However, I’m not sure I follow how to correct this.
It doesn’t make any sense that I would have set this up to access local drives using Samba. Yet apparently that’s what I’ve done.
The hard drives (yes - all 5 of them - I love movies and all at top quality!), are attached to the main Raspberry Pi (the “server”). I also have two other Pi’s that are “clients”. I use ethernet (wifi was just too slow with the size of the files).
MySql just seemed logical to setup for this system.
If you (or anyone) can direct me to a link(s) regarding changing this so that the local drives are accessed directly and the networked Pi’s use SMB, I would appreciate it. Maybe a link to something smaller than the Mysql or Smb manual! As you can see from the above, I am willing to try to figure this stuff out on my own once I’ve been given some assistance from more knowledgeable people than myself.
Thanks!

I would suggest if you have only Pi’s involved to use NFS mounted drives via fstab or autofs. That way your path names will be the same for all devices. That’s how I have my setup, and it works great.

Yes, if you are not accessing the Pi from Kodi on a PC, take @bmillham’s suggestion. My setup is the (single!) drive which has my media on is mounted at /mnt/ on the server. That is exported via NFS and all other devices mount that share at /mnt/ as well. So everything is interchangeable.

The problem you will have is if you do that you then have to go through your database and replace all instances of smb:\OSMC\foo and smb:\192.168.x.x\foo with /mnt//foo. Not sure how easy that is but I’m sure someone using MySQL can give you a steer on that.