
Stop the mysql service sudo service mysql stop UUID="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" $MOUNT_POINT ext4 defaults 0 2 Use sudo blkid to get the UUID of your disk. Update your /etc/fstab file to automatically mount on boot. Mount the drive sudo mount $DISK_LOCATION $MOUNT_POINT DISK_LOCATION="/dev/sdb"Ĭreate a filesystem sudo mkfs -t ext4 $DISK_LOCATIONĬreate a mount point sudo mkdir $MOUNT_POINT To make the steps agnostic, I am going to use the following variables which may vary on your system/configuration.


These steps can also be followed on Ubuntu systems, but will require some additional steps for configuring Apparmor. This tutorial will shown you how to move your database on a Debian 7.x server to another location, and are assuming another drive.

Alternatively, you may wish to move your database to a separate location because you want to configure some sort of snapshotting technique, such as with ZFS or LVM. Databases are constantly growing and it is likely to outgrow your / partition at some point, especially these days in the age of "the cloud" where you may be limited to a small / partition, but can pay to add bulk storage, or attach more disks.
