Operating System - HP-UX
1833873 Members
3677 Online
110063 Solutions
New Discussion

-z necessary in vgextend?

 
SOLVED
Go to solution
Matt Harrell
Advisor

-z necessary in vgextend?

When I use vgextend to add a disk that will be used for mirroring (-m 1 in lvextend), is it necessary to use the -z option in vgextend? It sounds like if I use -z, the mirror disk will only be used in a failure, but if I don't use -z, the mirror copy will be used simultaneously, improving performance. By the way, I'm planning on defining two PVG's and using "-s g" in the lvcreate commands. It seems in this case the -z in vgextend would be unnecessary (maybe even meaningless?).
5 REPLIES 5
S.K. Chan
Honored Contributor
Solution

Re: -z necessary in vgextend?

In my opinion using -z to create spare PV can get very confusing later on when you got a problem with your VG unless you're sure of what you're trying to do. If you're mirroring you LVs I would suggest skip the "-z" option.
James R. Ferguson
Acclaimed Contributor

Re: -z necessary in vgextend?

Hi Matt:

The spare ('-z') feature of 'vgextend' offers a high-availability feature. The spare volume isn't available (used) during normal operations but stands ready to serve as a replacement (via MirrorDisk/UX software) in the event that another physical disk in the volume group fails. Specifying '-z N' is the same as *not* providing the option at all (the default).

Regards!

...JRF...
Jeff Schussele
Honored Contributor

Re: -z necessary in vgextend?

Hi Matt,

As I see it -zy sets *spare* - which means that upon failure the disk has to be built. True mirrors have data written to them at approx the same time. So failover is essentially transparent.
Spares are more frequently used in RAID 5-type situations where the RAID keeps going while the spare is being built.
So it all depends on just exactly how you will construct your PVG.

The lvcreate -sg implies that you'll force the mirror to a seperate PVG. Again this will depend on just how you'll construct your PVG. Seems to me that if you don't stripe the disks then the lvcreate -sg *should* override the vgextend -zy as you call for a mirror - not a spare. Or probably since it's *spared* the PV will not be available for mirroring. Hopefully an LVM expert could answer this.

Personally I prefer the true mirror. But then again I don't normally use PVGs, But I believe I'll start looking at them as others have indicated that they're easier to admin.

Hope I haven't muddied the water too much......

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
James R. Ferguson
Acclaimed Contributor

Re: -z necessary in vgextend?

Hi (again) Matt & Jeff:

An additional comment. Sparing assumes / requires strict mirroring.

The idea behind LVM sparing is to offer automatic mirroring of data in the event that a mirrored copy (physical disk) fails, thereby enhancing data protection. Strict allocation is required to insure that data can be replicated from a good physical volume to the spare in the first place.

Regards!

...JRF...
Jeff Schussele
Honored Contributor

Re: -z necessary in vgextend?

Thanks JRF.

I understand sparing better now.
So one can have a 2 or 3 mirror copy & one in spare & when one of the mirrors fail then the spare is "promoted" & auto-mirrored - that's straight-forward.
I understood that strict allocation was to not allow mirroring to the same PV. Not using it has always seemed rather dense to me...I mean how often does just part of the disk go bad - as compared to the whole disk dying? Not to mention the doubling of head movement on the PV.

I knew somebody would clarify this for me....

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