LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
LinkBack Search this Thread
Old 03-09-2009, 06:29 AM   #1
eco
Member
 
Registered: May 2006
Location: BE
Distribution: Debian/Gentoo
Posts: 412

Rep: Reputation: 48
Question lvm snapshot for backup


Hi guys,

I have a Xen server which hosts a DomU mail server. The DomU is on a LV.

I'd like to use snapshots to backup the DomU but have a few questions I hope people can clarify.

1) Chosing the filesystem
I can confirm that doing a snapshot of a running ext3 system will lead to errors when booting the snapshot. The errors don't seem to be major but I'd like to avoid any risk. I hear some people use XFS to get arround that by doing a xfs_freeze before the snapshot. What do you think, use, recommend?

2) Snapshots
I read the following:
Quote:
Full snapshot are automatically disabled
If the snapshot logical volume becomes full it will be dropped (become unusable) so it is vitally important to allocate enough space. The amount of space necessary is dependent on the usage of the snapshot, so there is no set recipe to follow for this. If the snapshot size equals the origin size, it will never overflow.
I'd like to understand what they mean by that? How can the image of a LV increase in size? Is it not an image in time?

Any help would greatly be appreciated.
 
Old 03-10-2009, 03:38 AM   #2
eco
Member
 
Registered: May 2006
Location: BE
Distribution: Debian/Gentoo
Posts: 412

Original Poster
Rep: Reputation: 48
bump

It looks like the snapshot keeps a record of all changes done on the original LV from the time of the snapshot... but for what purpose?
 
Old 03-12-2009, 04:53 AM   #3
DaveG
Member
 
Registered: Nov 2001
Location: London, UK
Distribution: Fedora 16
Posts: 160

Rep: Reputation: 41
A snapshot is not a mirror image of the target volume. It works more like a revision control system - the snapshot volume keeps a list of changes that have to be undone on the target volume to take it back to the point the snapshot was taken.

Every change made to the target volume is recorded in the snapshot as the original is updated, so the snapshot volume grows in relation to update activity, eventually filling the snapshot volume. Once this happens there is no way to record new changes and LVM can no longer get back to the snapshot point and invalidates the snapshot volume rather than crash.

Using a snapshot for backup still requires that the target volume is "quiescent". In this case your mail server software must flush everything to disk and pause before taking the snapshot to ensure that you accurately capture the full application state rather than just what happens to be on disk at the time - LVM doesn't know about locking etc. The benefit is that the application can start running again as soon as the snapshot is taken. This is much quicker that a full backup or mirror operation.

Hope this helps.

--DaveG.
 
Old 03-15-2009, 04:13 AM   #4
eco
Member
 
Registered: May 2006
Location: BE
Distribution: Debian/Gentoo
Posts: 412

Original Poster
Rep: Reputation: 48
Hi DaveG,

Sorry for the late reply. Yes, most useful indeed.

I have a couple of questions left now, pointers to documentation are still welcome

If a snapshot is a point in time and is there to allow us to go back to the time of a snapshot...

After taking a snapshot:
1) If I want to run a test, do I run it on the original LV or the snapshot?
2) How do I use the snapshot to return to a state before the test was made (time of snapshot).

What I did was, snapshot, mount snapshot instead of original LV, if ok, remove snapshot and do the same on original LV... but it seems all wrong now.
 
Old 03-15-2009, 06:18 AM   #5
DaveG
Member
 
Registered: Nov 2001
Location: London, UK
Distribution: Fedora 16
Posts: 160

Rep: Reputation: 41
The best documentation I have found is the LVM HOWTO at http://www.tldp.org/HOWTO/LVM-HOWTO/index.html - Section 3.8 "Snapshots" and 13.4 "Taking a Backup Using Snapshots".

For testing something out with LVM2, create the snapshot and mount it in place of the original, run the test and, if all went well, discard the snapshot, re-mount the original and run again for real.

This way you side-step the issue of rolling back the original volume as it is unchanged during the testing, just like a quick mirror/backup copy. So you are "doing the right thing".

--DaveG.
 
Old 03-15-2009, 07:27 AM   #6
eco
Member
 
Registered: May 2006
Location: BE
Distribution: Debian/Gentoo
Posts: 412

Original Poster
Rep: Reputation: 48
Thanks for the reference and the thumbs up for my method.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
lvm snapshot Ammad Linux - General 1 02-18-2009 07:03 AM
LVM snapshot between different Groups Ammad Linux - General 3 01-04-2009 08:02 AM
LVM snapshot(configuring backup time) abhishekrahel Linux - General 1 10-07-2008 10:28 PM
About LVM Snapshot geethusari LinuxQuestions.org Member Intro 1 12-03-2007 07:11 AM
LVM Snapshot question sjtushi Linux - Software 3 03-12-2006 09:41 AM


All times are GMT -5. The time now is 09:00 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration