Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am writing a script to snapshot EBS volumes on AWS. One of the volumes contains the data for a mysql database. I am aware that I need to somehow stop data being written to the database while the snapshot is initiated so that the data is consistent but I cannot obtain a lock on all the tables on the database.

Will using xfs_freeze without a lock on the tables suffice for a consistent solution?

Ty

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

no, because mysql might still have data in it's own buffers, that the filesystem couldn't possibly know about.

the proper method is to "flush tables with read lock", THEN create a filesystem snapshot, after which you can immediately release the lock again.

why can't you obtain a lock?

share|improve this answer
    
@r001 I am trying to do all this in PHP ;) and its not very easy to get a lock on all tables in the database. –  mrwooster Dec 21 '10 at 8:18
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.