List:General Discussion« Previous MessageNext Message »
From:Simon J Mudd Date:December 2 2008 7:08am
Subject:Re: MySQl and LVM
View as plain text  
smiley@stripped (Shain Miley) writes:

> I am trying to  plan we in advance our methods for backup and recovery
> of our new MySQL replication cluster.  After doing some research it
> looks like a lot of people are using LVM snapshots as their backup
> solution.  We currently have two MySQL servers with 2 300 GB (Raid 1).
> What I am confused about is the best disk layout to use at this point.
>
> Do I need to create a separate volume for the snapshots?  Can anyone
> provide any suggestions on disk layout for two disks of this size?

The filesystem layout is largely irrelevant. Basically what you want
is to have all your mysql files on a separate LVM filesystem. So you
could do this by creating a new filesystem and mounting it at
/var/lib/mysql. Then install MySQL.

Once you have the filesystem mounted you can use mysql as normal.

To take snapshots do the following:

1. stop mysql
2. make a snapshot LV of the volume mounted at /var/lib/mysql
3. start mysql
4. mount the snapshot and back it up to a real filesystem or to tape or whatever.
5. unmount the snapshot and remove it.

4. Is very important as if you don't do this eventually the snapshot
will run out of space and suddenly it will lose its contents. It's
only a temporary staging area.

Hope this helps.

Simon

Thread
Intersect questionAndrej Kastrin1 Dec
  • Re: Intersect questionMicah Stevens1 Dec
    • MySQl and LVMShain Miley1 Dec
      • Re: MySQl and LVMSimon J Mudd2 Dec
        • Re: MySQl and LVMShain Miley2 Dec
    • RE: Intersect questionRolando Edwards1 Dec
  • Re: Intersect questionMicah Stevens1 Dec
  • Re: Intersect questionPeter Brawley1 Dec