Migrate the mysql partition bitsCN.com
Today, I found that I forgot to install the largest partition in the data directory of the master-slave mysql server load balancer and directly mounted it to the root partition. I have used root partition 95% below df, as long as the migration is complete.
Note:
A. It is an ec2 host. when provided by the partner, the maximum partition is mounted to/mnt, which is defined by ourselves.
Df-h Filesystem Size Used Avail Use % Mounted on/dev/sda1 9.9G 8.9G 529 M 95% // dev/sdb 827G 201 M 785G 1%/mnt B. the database directories are all under/data.
Procedure:
1. stop the database first
/Usr/local/bin/mysqladmin-S/tmp/mysql. sock shutdown/usr/local/bin/mysqladmin-S/tmp/mysql2.sock shutdown 2. move the mysql directory under/data to/mnt
Mv mysql/mnt 3. uninstall/mnt
# The parameter can be omitted because umount/mnt is defined in/etc/fstab. 4. edit the/etc/fstab file.
Vi/etc/fstab/dev/sdb/mnt ext3 defaults 0 0 # Change to/dev/sdb/data ext3 defaults 0 0 0 5. remount/data partition
Mount/data or mount/dev/sdb 6. restart the database and check the status.
Show slave status
This article is from the "linuxjcq" blog
BitsCN.com