LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   Some guidance needed on recovery using LVM Snapshots (http://www.linuxquestions.org/questions/linux-server-73/some-guidance-needed-on-recovery-using-lvm-snapshots-859042/)

pwl 01-27-2011 11:38 AM

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.

szboardstretcher 01-27-2011 11:45 AM

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.

z1p 01-27-2011 12:09 PM

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.]

pwl 01-28-2011 09:47 AM

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


All times are GMT -5. The time now is 07:11 AM.