I'm using symlinks to move some MySQL databases to another device with more space. All works fine until one of those DBs gets dropped and then re-created: the symlink is deleted in the process of dropping the database. And then a regular directory is created in place of the symlink, so the db end up on the "wrong" device.
I have also tried mounting a device on the path where the symlink would be, but then MySQL complains when dropping the database:
ERROR 1010 (HY000) at line 1: Error dropping database (can't rmdir './my_db', errno: 16 "Device or resource busy")
Is there a way to have my cake and eat it too? I.e. to move the database to another device and also have it there in case it gets deleted and re-created?
Using MariaDB 10.0.34 on Ubuntu 16.04