1753500 Members
3245 Online
108794 Solutions
New Discussion юеВ

Backup using mirroring

 
SOLVED
Go to solution
Todd McDaniel_1
Honored Contributor

Backup using mirroring

Okay my DBA emails me asking about fast backups using mirroring... IE, split mirrors and use m1 for backup...

I guess to take a cold backup of the m1 and either keep the m0 running.

I can only guess at this point.

I guess to then resync later... not exactly sure...

Any advice on the trepidation of doing this? Is it a viable option? is it inherently dangerous...

I will post back when I know more if it is needed.
Unix, the other white meat.
18 REPLIES 18
Pete Randall
Outstanding Contributor

Re: Backup using mirroring

Todd,

Yes, it's absolutely a valid method. It's even taught in HP's "Hands On With LVM and Mirror/UX" course.


Pete

Pete
Todd McDaniel_1
Honored Contributor

Re: Backup using mirroring

i think they are going to try and use it like pseudo BCV snapshot ... more to come.
Unix, the other white meat.
Todd McDaniel_1
Honored Contributor

Re: Backup using mirroring

Pete,

I had that course but it has been a few years...

Would that be with lvsplit or simply lvreduce -m1? How would I go about it?

I am very knowledgeable about LVM, just not in this manner.
Unix, the other white meat.
Jeff Schussele
Honored Contributor
Solution

Re: Backup using mirroring

Hi Todd,

Yes it can be done this way. But it's much safer to use a 3-way (-m 2) for this because with a 2-way mirror, when you split one away you'll have an SPOF for the time that it's not in the mirror set.

So you would do a
lvreduce -m 1 /dev/vg_name/lv_name /dev/dsk/cXtYdZ
to split it off
And a
lvextend -m 2 /dev/vg_name/lv_name /dev/dsk/cXtYdZ
to bring it back & sync it.

We did this with OpenMail datastore disks all the time. It assures the data is completely inactive for a backup of the data on that disk.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Paula J Frazer-Campbell
Honored Contributor

Re: Backup using mirroring

Hi
As said a very viable method, BUT

I would suggest using a tripple mirror on a live important database - spit one away and you still have a mirror safty net.

Basically
1. Split the mirror
2. Mount the mirror split
3. Back it up
4. Join the mirror.


Paula
If you can spell SysAdmin then you is one - anon
James A. Donovan
Honored Contributor

Re: Backup using mirroring

Jeff is right, but he got the commands wrong. You must use lvsplit and lvmerge, and NOT lvreduce/lvextend!
Remember, wherever you go, there you are...
Todd McDaniel_1
Honored Contributor

Re: Backup using mirroring

thanks jeff and paula...Great ideas, we use that with a BCV setup on my boxes for my application...

This however, is for an application unlike mine...they dont have BCVs.

heh my company is a big one and requires red tape/capacity planning/Project Creation, et al for disk purchases...long and drawn out..

they only have 2 mirrors m1 and m2... I fear they wont have time or $$ to get additional disks...

also, we are talking about 1TB of data here... across several fielsystems/LVOLS...

As I think about it more... I think they are going to be shooting themselves in the foot by trying to find a shortcut....
Unix, the other white meat.
Jeff Schussele
Honored Contributor

Re: Backup using mirroring

lvsplit has the added benefit of not having to backup the data raw. It creates a new LV with the name
/dev/vg_name/lv_nameb
it suffixes b to the org lv_name.
You have to fsck the "b" LV before you can mount it for "cooked" access.
You then umount the b LV use lvmerge to rejoin them.
But the same rule applies - A 2-way mirror split any way will leave you exposed for the amount of time it's not in the mirror set.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Jeff Schussele
Honored Contributor

Re: Backup using mirroring

Hi Jim,

No it's not wrong - it just depends on the backup method you intend to use.
You can lvreduce/lvextend if you are going to backup it up raw - like using dd or such.
There's more than one way to skin a cat my friend.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!