Skip to contentSkip to conversation

snapshot questions

linux-lvm Kyle Hayes 3 participants 3 messages Nov 2, 2001

lore
Share & tools
lore

Kyle Hayes

author
#0 lore raw

We are considering using LVM to do database snapshots for backups.

I have some questions that the HOWTO's etc. do not seem to answer. My largest concerns are that we will end up with a read-only corrupt filesystem. This seems to be a problem reported in the mailing lists.

1) how does the snapshot actually work? My understanding is that the creation of a snapshot partition sets up a new LV on the same VG as the "source" partition. This new partition is then used for writes to the "source" partition. When the snapshot LV is removed, do I get a disk IO hit as these changes are copied back to the "source" partition? Or, does it work more like Veritas where the changed data go to the "source" and the original values are copied to the snapshot partition? The Veritas method is nice because dropping the snapshot partition does not require any data copying.

2) are there any people using LVM for database snapshots? The Whitepaper from SuSE has examples for Oracle and the HOWTO's talk about it, but is it used in production? If so, what issues have you found?

3) what is the overall stability of snapshot functions? I have been following the pvmove thread with some alarm as I thought that LVM functionality was stable at this point. Is there a place that I can see what functionality is considered stable and what isn't? The mailing list archives do not paint a rosy picture of snapshot functionality.

4) It seems that most of the LVM work is going into 2.4. We have not been particularly pleased with the stability of 2.4 in general and would like to stay with 2.2 for a while. How does the stability of LVM on 2.2 compare to 2.4?

5) I have seen references to the VFS lock patch in the mailing list. Is this actually supported by any filesystems yet? Is it in the kernel proper?

Thanks.

Best,
Kyle

Signature · 10 lines
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MicroTelco Services saves money on every Fax:
- Fax to email (FREE)
- Fax to PSTN based Fax (Up to 95% Savings)
- Fax Broadcasting: Send 100s of faxes to fax machines
and email addresses in the time it takes to send just one!
===========================================================
    So send a fax today and let us know what you think! 
       For more info. visit: www.internetfaxjack.com
===========================================================
#1 lore raw
Quoted 9 lines · Kyle Hayes

1) how does the snapshot actually work? My understanding is that the creation of a snapshot partition sets up a new LV on the same VG as the "source" partition. This new partition is then used for writes to the "source" partition. When the snapshot LV is removed, do I get a disk IO hit as these changes are copied back to the "source" partition? Or, does it work more like Veritas where the changed data go to the "source" and the original values are copied to the snapshot partition? The Veritas method is nice because dropping the snapshot partition does not require any data copying.

It is like the veritas method - changes go into the original LV, and the old data is copied into the snapshot(s).

Quoted 4 lines

2) are there any people using LVM for database snapshots? The Whitepaper from SuSE has examples for Oracle and the HOWTO's talk about it, but is it used in production? If so, what issues have you found?

You probably need to put your tablespaces into "backup" mode temporarily when doing the snapshot. Otherwise there is no guarantee that what is currently on disk is any good.

Quoted 4 lines

4) It seems that most of the LVM work is going into 2.4. We have not been particularly pleased with the stability of 2.4 in general and would like to stay with 2.2 for a while. How does the stability of LVM on 2.2 compare to 2.4?

It should be pretty much identical. There are compatibility hooks for 2.2 and 2.4, and they both use an otherwise identical code base.

Quoted 3 lines

5) I have seen references to the VFS lock patch in the mailing list. Is this actually supported by any filesystems yet? Is it in the kernel proper?

Yes, reiserfs, ext3, and XFS all support the lock interface to the VFS. Note that the stock 2.4 kernel has the VFS methods for this, but is missing the code to do it. There is the capability to support this for ext3 on 2.2, but it is not in the stock code. I think the same is true for reiserfs.

Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/

#2 lore raw
In reply to Kyle Hayes

Hi, Kyle:

Quoted 3 lines · Kyle Hayes

We are considering using LVM to do database snapshots for backups.

It's so rare the case where this approach really works that it doesn't even deserve to be taken into consideration, so: DON'T EVER BACKUP A DATABASE THROUGH FILESYSTEM UTILITIES. The database has for sure methods to achieve this goal: use them.

Signature · 5 lines
SALUD,
Jes�s
***
[email protected]
***