I need to relocate mysql customer databases to another disk, for the purposes of:
1. Separation of user data from system files
2. Ease of backing up system and user data separately
3. Ease of upgrading the system
The following articles were helpful:
[how-to-move-mysql-datadir-to-another-drive][1]
[move-a-mysql-database-to-another-location][2]
Running on a ubuntu-18 system, it appears the innodb_file_per_table variable is set by default:
mysql> SHOW GLOBAL VARIABLES LIKE 'innodb_%';
...
| innodb_file_per_table | ON
...
(Same results without the GLOBAL)
I can't find any reference to innodb_file_per_table in any configuration files; the only file with much in it is
/etc/mysql/mysql.conf.d/mysqld.cnf
I'm concerned about what is still being stored in the files
/var/lib/mysql/ibdata1
/ib_logfileN
I've noticed that simply accessing a database causes these to be updated.
My questions are:
If I move only the customer databases (to a separate disk), and the system disk is lost and needs to be recreated from scratch, will anything be lost?
Am I better off moving all databases, including (mysql, performance_schema, and sys) to a separate disk?
Am I better off moving the entire data directory to a separate disk, pointing to it via the "datadir" variable in /etc/mysql/mysql.conf.d/mysqld.cnf?
What are the ramifications of not using option 3 if the system disk is lost?