I've followed these simple instructions in order to backup and restore an LXC container:
https://stackoverflow.com/a/34194341
The backup and restore procedure go well. I've made triple sure I use the --numeric-owner flag when tar and untar'ing, and the container starts up fine. However, MySQL in the container barfs all over the place with the following errors, when doing service mysql restart (output from journalctl -xe):
[ERROR] InnoDB: Unable to lock ./ibdata1, error: 11
and
[ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
I can get it to start up if I delete the following files, so that mysql recreates them:
/var/lib/mysql/ibdata1
/var/lib/mysql/ib_logfile*
/var/lib/mysql/aria_log_control
"Solution" gleaned from https://bbs.archlinux.org/viewtopic.php?id=160277
But this royally messes up my site database.
What is going on here?
It seems to me that file permissions, or something along those lines have gone awry - but when I compare ownership and rights between the original, working container and my restored copy, it all looks identical.