MySQL Directory Move Into New Partition (Example /home)
Login as root or any user that NOT using /home stop mariadb service such as systemctl stop MariaDB
Make sure SELINUX is permissive mode. View file /etc/selinux/config
To backup the contents of /home, do the following:
mkdir /newhome
cp -rfp /home/* /newhome
Once that is finished at your back at the prompt, you can proceed to step 2. Make sure your / is still enough by using command df -h
umount -fl /home
rmdir /home
mv /newhome /home
Using your preferred text editor, ensure you open /etc/fstab
and change of the line for /dev/mapper/cl-home (mount point at the begining of line)
Change only word /home to /var/lib/mysql
mv /var/lib/mysql /var/lib/mysql-old
mkdir /var/lib/mysql
chown mysql:mysql /var/lib/mysql
mount /var/lib/mysql
To copy the contents of /var/lib/mysql-old, do the following:
chown mysql:mysql /var/lib/mysql
cp -rfp /var/lib/mysql-old/* /var/lib/mysql
df -h
Run the following command to sync systemd up with the changes.
dracut --regenerate-all --force
This rescue option is useful if you have problems after adding new hardware. You can use the rescue option to regenerate the initramfs for all boot entries using the above command.
MySQL / MariaDB / Percona Server For MySQL Directory Move Into New Partition (Example /home)