0

We have an Amazon AWS Instance set up with a 30 GB Hard Disk. There is a MySQL Instance running that uses same hard disk. We have an Apache instance that hosts an application and uses this DB.

We'd like to increase the hard disk space available for the DB. What are the options?

  1. If we just attach another EBS disk, is it possible to make MySQL use this disk in addition to the first disk?
  2. If not, how easy or hard is it to "migrate" the database to new Hard Disk?

I'm assuming if 1 is not possible, the only option is to uninstall the DB and reinstall it so that it stores data on new disk.

1 Answers1

0

If we just attach another EBS disk, is it possible to make MySQL use this disk in addition to the first disk?

Yes you can, but that adds complexity.

If not, how easy or hard is it to "migrate" the database to new Hard Disk?

If you can accept a little bit of down time:

  • Take a backup of your database
  • Shut down MySQL
  • Change the configuration to point to the new drive
  • Restart MySQL
  • Restore from your backup

As with any migration procedure, practice in a test environment if at all possible. That's easy to do at AWS, as you can create an image of your instance then create a new server from that instance. Practice the procedure, then kill the extra instance.

I'm assuming if 1 is not possible, the only option is to uninstall the DB and reinstall it so that it stores data on new disk.

MySQL stores the datadir in its configuration file (my.cnf or my.ini). You just have to stop MySQL, edit the config file, then start it again.

There is also a third option. You can resize your existing EBS volume (Windows or Linux).

Community
  • 1
  • 1
Eric J.
  • 147,927
  • 63
  • 340
  • 553
  • Thanks for the reply. We're planning to expand the existing disk using instructions given at https://aws.amazon.com/premiumsupport/knowledge-center/expand-ebs-volume/, http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html, and http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ebs-expand-volume.html. – user5837230 Feb 19 '16 at 16:35