Skip to contentSkip to conversation

linux-lvm Digest, Vol 57, Issue 15

linux-lvm Antony MARTINEAU 2 participants 2 messages Dec 1, 2008 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Hello Lars,
Andreas was whith us the last week ;-)

So I think to that xfs_freeze is no needed during a snapshot LVM2 My backup Script do :
FLUSH TABLES WITH READ LOCK;
system lvcreate --snapshot -n $snapname -L$snapsize /dev/$vg/$lv; UNLOCK TABLES;
So i think it is the best way to backup

The last message about peter Keller worring me... You think to that XFS is not a filesystem that correspond whit database transactions??? I think XFS is actually the best FS on all domains... can i use XFS for mysql database??

De :
[email protected]
A:
[email protected]
Date:
28/11/2008 16:40
Objet :
linux-lvm Digest, Vol 57, Issue 15
Envoyé par :
[email protected]

Send linux-lvm mailing list submissions to
[email protected]

To subscribe or unsubscribe via the World Wide Web, visit
https://www.redhat.com/mailman/listinfo/linux-lvm
or, via email, send a message with subject or body 'help' to
[email protected]

You can reach the person managing the list at
[email protected]

When replying, please edit your Subject line so it is more specific than "Re: Contents of linux-lvm digest..."

Today's Topics:

1. XFS_freeze and LVM (Antony MARTINEAU)
2. Re: XFS_freeze and LVM (Falko Zurell)
3. Re: XFS_freeze and LVM (Peter Keller)
4. Re: XFS_freeze and LVM (Lars Ellenberg)

----------------------------------------------------------------------

Message: 1
Date: Thu, 27 Nov 2008 09:48:12 +0100
From: Antony MARTINEAU <[email protected]>
Subject: [linux-lvm] XFS_freeze and LVM
To: [email protected]
Message-ID:
<OFEEAC56CA.4D4B448B-ONC125750E.00300773-C125750E.00305B8E@lippi.fr>
Content-Type: text/plain; charset="us-ascii"

Skipped content of type multipart/alternative-------------- next part
--------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 5552 bytes
Desc: not available
Url :
https://www.redhat.com/archives/linux-lvm/attachments/20081127/420339a5/attachment.gif

------------------------------

Message: 2
Date: Thu, 27 Nov 2008 09:54:14 +0100
From: Falko Zurell <[email protected]>
Subject: Re: [linux-lvm] XFS_freeze and LVM
To: "LVM general discussion and development" <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"

Hi,

are your LVM tools on the freezed file system? Is this the / partition you are freezing? Bad idea ;-)

kind regards

Am 27.11.2008 um 09:48 schrieb Antony MARTINEAU:

Quoted 43 lines

Hello,
I want using LVM 2 and Mysql
So i have mounted /var/lib/mysql on /dev/vg0/mysql.

For doing a backup i want do
xfs_freeze -f /var/lib/mysql
and after : lvcreate --snapshot -n snap -L1G /dev/vg0/mysql.

But the problem is when i freeze xfs filesystem i can't use lvm commands...
When i unfreeze xfs lvm commands are available...

Do you know the problem?? is it a bug.??
Cordialement,

<ATT54517403.gif>
MARTINEAU
Antony
Service informatique
Assistant informatique
LIPPI Management La Fouillouse
16440 Mouthiers sur Boheme
Tel.: 05.45.67.34.35
Courriel: [email protected]
http://www.lippi.fr

Ce message et toutes les pieces jointes sont etablis a l'attention exclusive de ses destinataires et sont strictement confidentiels. Pour en savoir plus cliquer ici

This message and any attachments are confidential to the ordinary user of the e-mail address to which it was addressed and may also be privileged. More information

Quoted 5 lines

_______________________________________________
linux-lvm mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

Falko Zurell 

Head of Application Management

/i-d media AG
Ohlauer Straße 43
D-10999 Berlin

-------------- next part --------------
An HTML attachment was scrubbed...
URL:
https://www.redhat.com/archives/linux-lvm/attachments/20081127/38bf5e9b/attachment.html

------------------------------

Message: 3
Date: Thu, 27 Nov 2008 10:28:05 +0000 (GMT)
From: Peter Keller <[email protected]>
Subject: Re: [linux-lvm] XFS_freeze and LVM
To: LVM general discussion and development <[email protected]> Message-ID:
<[email protected]>
Content-Type: text/plain; charset="utf-8"

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.

Good luck,
Peter.

Quoted 8 lines · Falko Zurell

Date: Thu, 27 Nov 2008 09:54:14 +0100
From: Falko Zurell <[email protected]>
Reply-To: LVM general discussion and development <[email protected]>
To: LVM general discussion and development <[email protected]>
Subject: Re: [linux-lvm] XFS_freeze and LVM

Hi,
are your LVM tools on the freezed file system? Is this the / partition

you are

Quoted 13 lines

freezing? Bad idea ;-)

kind regards

Am 27.11.2008 um 09:48 schrieb Antony MARTINEAU:

Hello,
I want using LVM 2 and Mysql
So i have mounted /var/lib/mysql on /dev/vg0/mysql.

Quoted 5 lines

For doing a backup i want do
xfs_freeze -f /var/lib/mysql
and after : lvcreate --snapshot -n snap -L1G /dev/vg0/mysql.

But the problem is when i freeze xfs filesystem i can't use lvm

commands...

Quoted 21 lines

When i unfreeze xfs lvm commands are available...

Do you know the problem?? is it a bug.??
Cordialement,

<ATT54517403.gif>

MARTINEAU
Antony
Service informatique
Assistant informatique
LIPPI Management La Fouillouse
16440 Mouthiers sur Boheme
Tel.: 05.45.67.34.35
Courriel: [email protected]
http://www.lippi.fr

Quoted 5 lines

[eco.jpg]

Ce message et toutes les pieces jointes sont etablis a l'attention exclusive de ses destinataires et sont strictement confidentiels.

Pour en

Quoted 3 lines

savoir plus cliquer ici

This message and any attachments are confidential to the ordinary

user of

Quoted 1 line

the e-mail address to which it was addressed and may also be

privileged.

Quoted 9 lines

More information

_______________________________________________
linux-lvm mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

Quoted 12 lines

Falko Zurell 

Head of Application Management

/i-d media AG
Ohlauer Straße 43
D-10999 Berlin

--
Peter Keller Tel.: +44 (0)1223 353033
Global Phasing Ltd., Fax.: +44 (0)1223 366889
Sheraton House,
Castle Park,
Cambridge CB3 0AX
United Kingdom

------------------------------

Message: 4
Date: Fri, 28 Nov 2008 16:39:40 +0100
From: Lars Ellenberg <[email protected]>
Subject: Re: [linux-lvm] XFS_freeze and LVM
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=iso-8859-1

Quoted 3 lines · Peter Keller

Hi,

IIRC sometime around 2005 developments in LVM meant that using

xfs_freeze

Quoted 1 line

before creating a snapshot became the wrong thing to do. See the entry

in

Quoted 3 lines

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

Quoted 8 lines

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

Quoted 4 lines

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.

Signature · 34 lines
: 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.



------------------------------

_______________________________________________
linux-lvm mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-lvm

End of linux-lvm Digest, Vol 57, Issue 15
*****************************************










Ce message et toutes les pieces jointes sont etablis a l'attention 
exclusive de ses destinataires et sont strictement confidentiels. Pour en 
savoir plus cliquer ici

This message and any attachments are confidential to the ordinary user of 
the e-mail address to which it was addressed and may also be privileged. 
More information
#2 lore raw

Dear Antony,

Quoted 10 lines · Antony MARTINEAU

Hello Lars,
ᅵAndreas was whith us the last week ᅵ;-)

So I think to that xfs_freeze is no needed during a snapshot LVM2 My backup Script do :
FLUSH TABLES WITH READ LOCK;
system lvcreate --snapshot -n $snapname -L$snapsize /dev/$vg/$lv; UNLOCK TABLES;
So i think it is the best way to backup

Quoted 4 lines

The last message about peter Keller worring me... You think to that XFS is not a filesystem that correspond whit database transactions??? I think XFS is actually the best FS on all domains... can i use XFS for mysql database??

There is no reason to be worried about the compatability of MySQL and XFS filesystems. The word "correspond" is a bit of a "faux ami": it can mean very different things in French and English even though it is written the same way in both languages, which I think is the source of your confusion here.

I used it in the (English) sense of "is equivalent to". I did not mean it in the sense of: "is compatible with". I was also using the word "transaction" in its narrow technical sense of a set of operations that take effect completely or not at all. If you read discussions about the XFS filesystem (or indeed any journaling filesystem), you will find that its operation is discussed using traditional database terminology (transactions, commits, etc.).

The point that I was making is that some people seem to be misled by this into assuming that a a single transaction in a database is implemented using a single transaction on each of the underlying filesystems where data are being changed. If they implement a backup strategy that is based on this assumption, they will probably get backups that are less reliable than if they use the "FLUSH TABLES WITH READ LOCK" strategy.

Regards,
Peter.

--
Peter Keller Tel.: +44 (0)1223 353033
Global Phasing Ltd., Fax.: +44 (0)1223 366889
Sheraton House,
Castle Park,
Cambridge CB3 0AX
United Kingdom