#!/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 |
#!/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