September 2014
Intermediate to advanced
298 pages
6h 13m
English
Logical volume manager (LVM) allows you to create a quick snapshot that can be used for backups. Apart from that, you can perform migration with easy rollback. This is a little bit out of the scope of this chapter, but as it is quick and could be very useful, we'll discuss it.
LVM is not a MariaDB tool, but a device mapper solution providing snapshot solutions. If you're using advanced filesystems such as ZFS or BTRFS, you can also use the snapshot feature to create backups.
To make a usable MariaDB datadir snapshot, you first need to lock your tables:
MariaDB [(none)]> flush tables with read lock;
Now we're sure there will be no changes on our instance. Let's create the snapshot on the system:
> lvcreate --snapshot -n snap_mariadb ...Read now
Unlock full access