I moved my data directory to another location. It works if this is on the same disk, just at a different location (i.e., moved /var/lib/mysql/ and edited the datadir entry in the server.cnf).
However, when the data directory is on a mounted drive it does not work well. It generally works, but when the system boots, MariaDB times out.
I changed the systemd service for mariadb to ensure that mounting took place: I added RequiresMountsFor=/mnt/foo. I can see by the timestamps that the service is started as soon as the disk is mounted. Starting MariaDB works occasionally, but most times mariadb times out:
Starting it manually after works fine.