Skip to content

Cannot mount mariadb volume #51

@stefanpl

Description

@stefanpl

Hi,

I'm trying to create a bind mount to persist mariadb data on my host. Having this in my mariadb service definition in docker-compose.yml:

    volumes:
     - ./db-volume-data:/var/lib/mysql

I created the folder db-volume-data in the root directory. mariadb containers fails with the following error:

Initializing database
2019-09-14  9:54:56 0 [Warning] InnoDB: Failed to set O_DIRECT on file./ibdata1; OPEN: Invalid argument, continuing anyway. O_DIRECT is known to result in 'Invalid argument' on Linux on tmpfs, see MySQL Bug#26662.
2019-09-14  9:54:56 0 [ERROR] InnoDB: The Auto-extending innodb_system data file './ibdata1' is of a different size 0 pages than specified in the .cnf file: initial 640 pages, max 655360 (relevant if non-zero) pages!
2019-09-14  9:54:56 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2019-09-14  9:54:57 0 [ERROR] Plugin 'InnoDB' init function returned error.
2019-09-14  9:54:57 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2019-09-14  9:54:57 0 [ERROR] Unknown/unsupported storage engine: InnoDB
2019-09-14  9:54:57 0 [ERROR] Aborting
Installation of system tables failed!  Examine the logs in
/var/lib/mysql/ for more information.
The problem could be conflicting information in an external
my.cnf files. You can ignore these by doing:
    shell> /usr/bin/mysql_install_db --defaults-file=~/.my.cnf
You can also try to start the mysqld daemon with:
    shell> /usr/bin/mysqld --skip-grant-tables --general-log &
and use the command line tool /usr/bin/mysql
to connect to the mysql database and look at the grant tables:
    shell> /usr/bin/mysql -u root mysql
    mysql> show tables;
Try 'mysqld --help' if you have problems with paths.  Using
--general-log gives you a log in /var/lib/mysql/ that may be helpful.
The latest information about mysql_install_db is available at
https://mariadb.com/kb/en/installing-system-tables-mysql_install_db
You can find the latest source at https://downloads.mariadb.org and
the maria-discuss email list at https://launchpad.net/~maria-discuss
Please check all of the above before submitting a bug report
at http://mariadb.org/jira

Happens for both vanilla installs and mounted wordpress. I'm on Linux Mint 18.3, which is based on Ubuntu 16.04. Even tried to slap a 777 on the db-volume-data folder, did not help.

Any insights here would be greatly appreciated, as this problem renders your (very promising-looking!) product useless. I don't want to lose my data every time I docker-compose down

Thanks a lot in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions