Storing MySQL data, indexes, and logs on LVM

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
mechamecha
Forum Commoner
Posts: 32
Joined: Thu May 31, 2007 8:49 pm

Storing MySQL data, indexes, and logs on LVM

Post by mechamecha »

Hey All,
I have a urgent MySQL question. I've posted on the MySQL forum but have yet to get a response.

I have two hard drives on a dedicated host. The first hard drive has my lamp(apache, mysql, php) install and the second hard drive is empty. I would like to install LVM on the second hard drive and user it to store all the mysql data, indexes, and logs. This way, I can use zmanda recovery manager to take lvm snapshots of this drive to backup my db.

I want to know how I am suppose to get the mysql data onto this second harddive. Is it as simple as editing the my.cnf and changing the location of the datadir? Or do I have to reinstall mysql directly onto the second harddrive?

Thanks!
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Storing MySQL data, indexes, and logs on LVM

Post by Christopher »

mechamecha wrote:I want to know how I am suppose to get the mysql data onto this second harddive. Is it as simple as editing the my.cnf and changing the location of the datadir? Or do I have to reinstall mysql directly onto the second harddrive?
I should be as easy as stopping MySQL, copying the data dir to the second drive, editing my.cnf with the path to the data dir on second drive, and restarting MySQL.
(#10850)
Post Reply