LinuxQuestions.org
Visit the LQ Articles and Editorials section
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
 
Search this Thread
Old 01-27-2011, 10:38 AM   #1
pwl
LQ Newbie
 
Registered: Apr 2010
Posts: 5

Rep: Reputation: 0
Question Some guidance needed on recovery using LVM Snapshots


I have read the articles suggested on using LVM and importantly Snapshots but I need o understand something about the recovery as follows:

I understand that if I lose some, but not all disks in my LVM - the LVM software will cope and I can get the data back

BUT if I lose all of the disks in the LV - and I only have a snapshot backed up on tape, can I recover all of the data ?

Do I need all of the snapshots since the last full copy ? or what ?

Also, related, can this tape backup be of any use to me if I rebuild the system, without any other data, on a new server ?

Maybe I missing something in the articles but this does not appear to be looked at.
 
Old 01-27-2011, 10:45 AM   #2
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 3,276
Blog Entries: 1

Rep: Reputation: 1054Reputation: 1054Reputation: 1054Reputation: 1054Reputation: 1054Reputation: 1054Reputation: 1054Reputation: 1054
Here is a plain explanation of LVM Snapshots and how they work.

http://tldp.org/HOWTO/LVM-HOWTO/snapshots_backup.html

To answer your question, a snapshot, is not incremental. It is a full backup of whatever file system you are making a snapshot of. So, if you make a snapshot of /home/ then the snapshot will have everything that was in /home/ at the time of the snapshot.

Last edited by szboardstretcher; 01-27-2011 at 10:47 AM.
 
1 members found this post helpful.
Old 01-27-2011, 11:09 AM   #3
z1p
Member
 
Registered: Jan 2011
Location: the right coast of the US
Distribution: Ubuntu 10.04
Posts: 80

Rep: Reputation: 23
Hello pwl,

1st off the backup of a snapshot will contain the same data as the original volume. So, if you could do a full recovery of that backup if it was taken of the original volume, then you could do a full recovery of the same backup taken from the snapshot. [Note: since the snapshot will most likely be mounted at a different location than the original volume, you will basically have to do an out of place restore if you want to recover from tape to the original volume.]


An LVM snapshot is a Point In Time(PIT) copy of the original volume. So, if you backup a snapshot your backup will be of the volume at the time the snapshot was created.

You can use snapshots in backups in several ways.

1) Take a snapshot of the volume, backup the snapshot, delete the snapshot.

The advantage of doing this over just backing up the volume is that you only need to worry about keeping the volume in a consistent state while the snapshot is being taken, not for the whole time it takes to write the backup to media.

Also, if the snapshot is on different hard disks than the original volume, then you lessen the performance impact on the original volume.


2) Take a snapshot of a volume, backup the snapshot, keep the snapshot until the next backup.

This has the same advantage as the 1st backup wise, additionally if you need to recover data from the last backup, you have the option of recovering it from the snapshot, which would be faster than recovering from the backup media.

3) Take a snapshot every N hours and backup every M snapshot to tape.

Since a snapshot takes less time and impacts a system less than doing a full backup, it is possible to do it more often. Say you take a snapshot every 8 hours and roll every 3rd snapshot to tape. This way you would have a daily backup on tape to recover data that is older than a day or for a catastrophic recovery. Additionally, you would have a a backup from 8, 16 & 24 hours ago, that you can quickly recover from. You just need the hardware resources to do it.

You will pay a performance penalty for enabling snapshots, but I don't know if that has been quantified by anyone, especially it can vary widely depending on the usage pattern of the volumes.


[sorry szboardstretcher, I didn't mean to post over you. I'm just a slow writer and didn't see your post till I posted.]

Last edited by z1p; 01-27-2011 at 11:11 AM.
 
1 members found this post helpful.
Old 01-28-2011, 08:47 AM   #4
pwl
LQ Newbie
 
Registered: Apr 2010
Posts: 5

Original Poster
Rep: Reputation: 0
Smile Some guidance needed on recovery using LVM Snapshots

Thanks szboardstretcher and z1p

I can now investigate further on this with some confidence.

And again a special thank you
 
  


Reply

Tags
lvm


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Periodic LVM snapshots hydraMax Linux - Server 4 11-27-2010 04:14 PM
LVM Snapshots, can they be disabled? Stiken Linux - Newbie 2 01-29-2010 02:57 PM
HDD with single LVM partition, overwritten MBR, recovery needed San-Raal Linux - General 2 10-15-2008 03:58 AM
LVM snapshots: How to use? gargamel Linux - Server 12 02-24-2008 02:57 PM
LXer: Back Up (And Restore) LVM Partitions With LVM Snapshots LXer Syndicated Linux News 0 04-17-2007 11:16 AM


All times are GMT -5. The time now is 03:57 AM.

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