Databases Reference
In-Depth Information
Figure 15-1. How copy-on-write technology reduces the size needed for a volume snapshot
You can theoretically snapshot an enormous volume and consume very little physical
space with this technique. However, you need to set aside enough space to hold all the
blocks you expect to be updated in the original volume while you hold the snapshot
open. If you don't reserve enough copy-on-write space, the snapshot will run out of
space, and the device will become unavailable. The effect is like unplugging an external
drive: any backup job that's reading from the device will fail with an I/O error.
Prerequisites and configuration
It's almost trivial to create a snapshot, but you need to ensure that your system is
configured in such a way that you can get a consistent copy of all the files you want to
back up at a single instant in time. First, make sure your system meets these conditions:
• All InnoDB files (InnoDB tablespace files and InnoDB transaction logs) must be
on a single logical volume (partition). You need absolute point-in-time consistency,
and LVM can't take consistent snapshots of more than one volume at a time. (This
is an LVM limitation; some other systems do not have this problem.)
• If you need to back up the table definitions too, the MySQL data directory must
be in the same logical volume. If you use another method to back up table defini-
tions, such as a schema-only backup into your version control system, you might
not need to worry about this.
• You must have enough free space in the volume group to create the snapshot. How
much you need will depend on your workload. When you set up your system, leave
some unallocated space so that you'll have room for snapshots later.
LVM has the concept of a volume group , which contains one or more logical volumes.
You can see the volume groups on your system as follows:
 
Search WWH ::




Custom Search