今までmysqldumpを使ったデイリーバックアップを行っていたんですが、 いざ障害時に復旧しようとすると、SQLの実行のための時間がかかりすぎる、MERGEテーブルに対応していない(のでSQLをsedで書き換えるハメになった)等の理由から、LVMスナップショットバックアップに移行することにしました。 というわけでさっき /dev/ssdvg/lv01 を/var にマウントした環境において MySQLのデータディレクトリ /var/lib/mysql/favotter/ をLVMスナップショットバックアップする というスクリプトを書きました。何かの参考にするために上げておきます。LV消したりとか危ない事を自動化しているので、これを使ったり参考にしたりした事によるいかなる損害も保障しません。また、このスクリプトを実行する前に、バックアップしたいVolumeGroup上に、スナップショット用