[linux-lvm] XFS_freeze and LVM

Lars Ellenberg lars.ellenberg at linbit.com
Fri Nov 28 15:39:40 UTC 2008


On Thu, Nov 27, 2008 at 10:28:05AM +0000, Peter Keller wrote:
> Hi,
>
> IIRC sometime around 2005 developments in LVM meant that using xfs_freeze 
> before creating a snapshot became the wrong thing to do. See the entry in 
> the changelog for revision 0.15 of the LVM how-to at  
> http://tldp.org/HOWTO/LVM-HOWTO/ . You will probably find that 
> authoritative recommendations to use xfs_freeze relate to versions of LVM 
> from before this time. (Please correct me if I am wrong about this, 
> someone.)
>
> Also bear in mind that filesystem transactions do not correspond to 
> database (i.e. MySQL) transactions. To get a reliable backup using a 
> snapshot you may need to allow uncommitted database transactions to 
> complete or roll back while preventing new ones from being started, then 
> take the snapshot. Oracle has a way of doing this that doesn't need the 
> database to be completely shut down, but I have no experience with MySQL 
> so I can't be more specific.

at some stage lvm/devicemapper started to do the freeze implicitly
(on file systems that support freeze), and somewhen in between I think
there was a deadlock on "double freeze" (some long time ago).
maybe that is what you see.

on "modern" systems, it should work either way, with or without the
explicit freeze (as long as you don't try to freeze your root fs,
probably).

for mysql and (innodb) transaction safety, yes,
it is enough to use (writeable) snapshots.

however, iirc, you better do a "FLUSH TABLES WITH READ LOCK" (which may
take a long time, as it waits for all pending statements to complete),
then create the snapshot (which implicitly also freezes/unfreezes the
fs), and "UNLOCK TABLES" again.

-- 
: Lars Ellenberg
: LINBIT | Your Way to High Availability
: DRBD/HA support and consulting http://www.linbit.com

DRBD® and LINBIT® are registered trademarks of LINBIT, Austria.




More information about the linux-lvm mailing list