To create a clone of a SQL server from scratch (~pseudocode):

  • iptables -A INPUT -p tcp --dport mysql -j REJECT
  • Wait for connections to die down
  • mysql -e "show master status" and save the output
  • mysqladmin shutdown
  • umount /path/to/mysqldata
  • sync
  • lvcreate -s -L 10G -n snapshot /dev/vg/mysqldata
  • mount /path/to/mysqldata
  • /etc/init.d/mysql restart
  • Copy from /dev/vg/mysqldata at your leisure
Last modified 9 years ago Last modified on Feb 4, 2013, 10:26:32 PM