-
Notifications
You must be signed in to change notification settings - Fork 448
Open
Description
Heya, maybe an easy question to answer. Is it possible to mount a data directory in read-only mode?
We have an archive drive on our cluster that is read-only by default, and I want to access data from an old MariaDB database occasionally. The database is multiple terabytes in scale so I want to prevent copying if possible. I tried testing this with Docker Compose, but ran into multiple issues:
- Entrypoint chown : The official
docker-entrypoint.sh
tries tochown
all files in the datadir, which fails on a read-only filesystem. - Server startup writes : Even bypassing the entrypoint, MariaDB tries to create test files(
*.lower-test
) and will abort with (Errcode: 30 "Read-only file system")
Minimal Compose example:
services:
mariadb:
image: mariadb:latest
container_name: old_mariadb
volumes:
- ./data:/mnt/data:ro # read-only dataset
ports:
- "3306:3306"
entrypoint: ["mariadbd"] # bypass entrypoint to skip chown
command: >
--datadir=/mnt/data
--basedir=/usr
--read-only=ON
--skip-log-bin
--tmpdir=/var/tmp
I thought this might be a good place to ask the question, has anyone run into the same issue? Any suggestions for running MariaDB directly on a read-only datadir would be highly appreciated. I might be missing something crucial here.
[ERROR] mariadbd: Can't create/write to file './ddl_recovery.log' (Errcode: 30 "Read-only file system")
[ERROR] DDL_LOG: Failed to create ddl log file: ./ddl_recovery.log
[ERROR] Aborting
Metadata
Metadata
Assignees
Labels
No labels