Monthly Archives: March 2014

lvm snapshot mysql data dir

#!/bin/bash   ( echo "FLUSH TABLES WITH READ LOCK;" echo "\! lvcreate -L +10G -s -n snap_userdata /dev/vol01/userdata" echo "UNLOCK TABLES;" ) | mysql -u root   if [ -e /dev/vol01/snap_userdata ]; then mount /dev/vol01/snap_userdata /mnt/snap_userdata/ fi

Posted in admin, scripts | Leave a comment