[mythtv-users] cannot restore database

Mike Perkins mikep at randomtraveller.org.uk
Mon Feb 23 09:19:50 UTC 2015


On 23/02/15 02:18, Hika van den Hoven wrote:
> Hoi UB40D,
>
> Monday, February 23, 2015, 12:55:35 AM, you wrote:
>
>> On 22 February 2015 at 09:08, Hika van den Hoven <hikavdh at gmail.com> wrote:
>
>>> Coming back to you having /var/var/log and you finding an ancient
>>> file in /var/lib/mysql/mythconverg.
>>>
>
>> Yeah, it's weird and slightly annoying but I'm not terribly worried about
>> that.
>
>
>>> My guess is that you somehow have in the past moved your /var
>>> directory up
>
>
>> Probably right: I imagine I must have done that when I was trying to rescue
>> the drive that then turned out to have a physical fault (a bad idea, in
>> retrospect, if I had suspected that that was the problem). I then copied
>> the whole file system, as far as I could, to a new drive, which is what we
>> see now. Shortly afterwards, the old drive died completely.
>
>> and that your had a mysql directory in
>>> /var/var/lib/mysql. This totally confusing your system!
>>>
>
>> Probably wrong. I don't think anything points there. It's just a place
>> where there's a snapshot of the old /var.
>
>
>>> What are the dates of the files that occur both in /var/... and
>>> /var/var/... It would give you an indication about when things started
>>> to go wrong.
>>>
>
>> The dates seem to confirm the hypothesis that I made the copy while
>> attempting to rescue those read errors.
>
>> To prove that the system is far from being "totally confused", I have now
>> renamed /var/var to /var/unused-var-probably-a-copy. Stuff still seems to
>> work. If nothing chokes after a while, I'll delete it.
>
> I hope it works. The fact is that most files in /var will
> automatically be recreated when missing, but in a basic form, without
> the original contents.
> If that happened at that time of you previous problems with some of
> your mysql files it could explain your problems with dumping the
> database. Missing info!
>
There's a fun gotcha with that.

Whenever you reinstall - on Debian / Ubuntu at least - the OS creates all the 
system users afresh and assigns them all fresh UIDs / GIDs. But it doesn't 
delete and recreate directories below /var...

...which means that, if there are slight differences in the new install, a new 
system user is created along the way (or an old one is deleted), the directories 
under /var can end up being wrongly named or belonging to the wrong users... 
such fun!

I even ended up with a circular directory reference which could only be resolved 
by doing a clean install, nuking everything.

-- 

Mike Perkins



More information about the mythtv-users mailing list