After a few hours, I’m not sure how to entitle this post, so I’m quoting all the suspects.
I am migrating a dedicated server running Debian 12 with LXC, nginx as a reverse proxy, and a couple of containers. I use rsync with -avhze
options.
MariaDB inside one of the containers doesn’t start, and it seems that the permissions on some files have changed through rsync.
Details :
What I did so far, in broad outline :
- Install Debian 12 and packages I need on the new server (nginx, LXC, …)
rsync -avhze /etc/[someSelectedFolders]
and other config folders / files (not all/etc
but only those relative to packages of the same version)rsync -avhze /var/lib/lxc
on the new server- Start a first container that serves a dokuwiki site : all is fine (after managing certificate et DNS of course)
- Start a 2nd container serving a Nextcloud instance : that’s where the trouble starts… despite I already did a migration a few years ago, with the same process, without problems…
The LXC container starts, but inside it, MariaDB doesn’t start (code=exited, status=1/FAILURE
).
From the container, /var/log/mysql/error.log
says :
2024-07-10 18:04:08 0 [Note] Starting MariaDB 11.4.2-MariaDB-deb12 source revision 3fca5ed772fb75e3e57c507edef2985f8eba5b12 as process 197
2024-07-10 18:04:08 0 [Note] Using unique option prefix 'myisam-recover' is error-prone and can break in the future. Please use the full name 'myisam-recover-options' instead.
2024-07-10 18:04:08 0 [ERROR] InnoDB: The data file './ibdata1' must be writable
2024-07-10 18:04:08 0 [ERROR] InnoDB: The data file './ibdata1' must be writable
2024-07-10 18:04:08 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2024-07-10 18:04:08 0 [Note] Plugin 'FEEDBACK' is disabled.
2024-07-10 18:04:08 0 [Note] Plugin 'wsrep-provider' is disabled.
2024-07-10 18:04:08 0 [Note] Zerofilling moved table: './mysql/plugin'
2024-07-10 18:04:08 0 [ERROR] Unknown/unsupported storage engine: InnoDB
2024-07-10 18:04:08 0 [ERROR] Aborting
After an nth check of the permissions on /var/lib/mysql/
, I noticed that the owner and group has changed through rsync -avhze ...
:
Old server :
root@mycontainer:/# ls /var/lib/mysql/
...
-rw-rw---- 1 mysql mysql 290M 10 juil. 18:10 ibdata1
...
New server :
root@mycontainer:/# ls /var/lib/mysql/
...
-rw-rw---- 1 996 polkitd 290M Jul 10 17:58 ibdata1
...
Despite the -a
option, which preserves owner, groups and permissions.
I checked with less /etc/passwd
that the users are identical in both copies of the container.
So my questions are :
- How is it possible ? And who’s fault is that ? (rsync, mariadb less likely, other ?)
- What is the good way to solve this ?
- Which other files may be affected ? How could I check this “container-widely” if necessary ?
Thanks in advance for any tip!
Kiv is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.