[mythtv-users] Seek Table Problem

Stephen Worthington stephen_agent at jsw.gen.nz
Wed Aug 14 08:00:26 UTC 2013


On Wed, 14 Aug 2013 07:10:40 +1200, you wrote:

>On Tue, 2013-08-13 at 09:41 -0400, Ken Mandelberg wrote:
>> After a system crash new recordings have a messed up seek table. I ran a 
>> mythcommflag rebuild on one of them and get a lot of
>> 
>> --
>> 
>> 2013-08-13 09:35:30.333242 E  DB Error (delta position map insert):
>> Query was:
>> INSERT INTO recordedseek (chanid, starttime, mark, type, offset)  VALUES 
>> ( ? , ? , ? , ? , ? )
>> Bindings were:
>> :CHANID=3868, :MARK=47959, :OFFSET=1642327, :STARTTIME=2013-08-13T03:00:00Z,
>> :TYPE=33
>> Driver error was [2/126]:
>> QMYSQL3: Unable to execute statement
>> Database error was:
>> Incorrect key file for table './mythconverg/recordedseek.MYI'; try to 
>> repair it
>> 
>> ---
>> 
>> What can I do to repair this?
>> 
>> 
>I would first backup existing DB tables with backup script from MythTV
>wiki.
>Then run repair & optimize tools from mythweb (for from terminal).
>
>Could then run DB backup again, then check size of 2 backups..
>If this reveals large data loss then could be better to restore a recent
>DB backup (if there is one).
>
>Check your mythcommflag --rebuild cmd again..
>
>Any orphaned recordings can be located by an appropriately named script
>& relocated to videos storage.

If you are running Mythbuntu, then there is a button in the Mythbuntu
Control Center on the MySQL tab to "Optimise Tables".  That might be
sufficient to repair your database.  Below that are two options that I
always turn on:

  Enable Daily MySQL DB Optimise/Repair cron job
  Enable MySQL performance tweaks

The first of those options runs the "Optimise Tables" job every day
automatically, which might help prevent you getting a corrupt database
again.

Also, the database is automatically backed up weekly by this cron job:

  /etc/cron.weekly/mythtv-database

Part of what that cron job does is:

  DBNAME="mythconverg"
  DEBIAN="--defaults-extra-file=/etc/mysql/debian.cnf"

  /usr/bin/mysqlcheck $DEBIAN -s $DBNAME

which checks the database for errors before doing a backup.  I
recommend copying that file to /etc/cron.daily and modifying it to
backup to a different PC on your network (or at least to a different
hard drive).  I think weekly backups are too infrequent for safety.


More information about the mythtv-users mailing list