How to start mysqld with read-only data directory?
Please note the InnoDB Architecture (Pictorial Representation by Percona CTO Vadim Tkachenko)



The system tablespace file ibdata1 has moving parts requiring writes


Data Dictionary
Double Write Buffer


Safety Net to Prevent Data Corruption
Helps Bypass OS for Caching

Insert Buffer (Streamlines Changes to Secondary Indexes)
Rollback Segments
Undo Logs


It's good you have --innodb-read-only set to InnoDB handle read-only situations.

You also need to make sure innodb_change_buffering is 0.

You also needed to make sure that crash recovery never happens. Here is how to set  it up.

First, with the database on a writeable media, login to MySQL and run this:

mysql&gt; set global innodb_fast_shutdown = 0;


Then, go to the OS and run

service mysql stop


With innodb_fast_shutdown enabled, this cause mysqld to purge everything and its grandmother out of the InnoDB plumbing upon shutdown.

Next, move the datadir to the readonly media.

Then, add this to my.conf

[mysqld]
innodb_change_buffering = 0
innodb_read_only = 1


Finally, go start mysql with service mysql start and InnoDB should start very quickly because there will be no need to perform crash recovery since everything was purged out of the InnoDB plumbing beforehand.