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/* /newhomeOnce 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 /homermdir /homemv /newhome /homeUsing 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-oldmkdir /var/lib/mysql
chown mysql:mysql /var/lib/mysql
mount /var/lib/mysqlTo 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/mysqldf -hRun the following command to sync systemd up with the changes.
dracut --regenerate-all --forceThis 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)