Operating System - HP-UX
1838511 Members
2782 Online
110126 Solutions
New Discussion

Converting from non-strict mirror to strict

 
XPEN-Paul
Occasional Contributor

Converting from non-strict mirror to strict

Hi Gurus - grab a tea/coffee (other beverages are also available), and your favourite arm-chair then settle in please for this one ...

I have a customer who, for reasons unknown and pre-dates my involvement, has their data disks lvols in non-strict mirrors, with the mirrored pairs residing on SANs at two adjacent sites.  These SANs are then snapshot replicated over to a DR centre, but crucially the snapshots for each SAN are always slightly apart - leading to slightly out of sync snapshot mirror pairs (if that makes sense!).   (This time difference apparently can't be fixed by the way, because it's snapshotting two different SANS, albeit each contains a disk from a mirror-pair)!

We've run into issues (not all the time), when we then try to present a single SAN snapshot copy of just one SAN set of disks to a DR server - given we know the snapshot pairs are out of sync, we only present one or other set, such that when we import the volume groups and disks (and re-ID the disks) - all of which works okay, when we then come to fsck the non-strict lvols, they will sometimes error - due I believe to only presenting one side of the mirror pairs, and then there are 'missing' extents from the half of the mirror we're trying to use.

I believe a solution to having extents split between the mirrored disks is to change from non-strict to strict - for which the lvchange command cannot be used (it allows strict to non-strict change, but not the other way around), so we need to break the mirror and re-create using strict mode.

(I have also seen a post from back in 2012, here on the forums, where it says using non-strict mirrors is definitely not a good thing, whereby losing either disk may result in both sides of any given mirror then being unusable (which seems to match our experience with the non-strict lvols when we can only mount one set of disks at the DR centre).

My question is (and I'm pretty sure in breaking the mirror via lvreduce it must handle this) ... when doing the lvreduce -m 0, does it properly recover all extents that might only be on the second disk in the pair, back to the remaining 'primary' disk, so you do then have a single, fully intact copy of all extents? I'd then go create a new mirror that's in 'strict' mode.

Many thanks for any feedback/comments or further questions on this one.

Paul

 

1 REPLY 1
Azr_geek
Frequent Advisor

Re: Converting from non-strict mirror to strict

Hello @XPEN-Paul,

When you run lvreduce -m 0 on a mirrored logical volume, the tool removes the mirror, leaving you with a single copy of the data on the specified physical volume. During this process, lvreduce will attempt to copy any extents that exist only on the mirror leg being removed back onto the remaining leg, ensuring that the resulting single logical volume contains a complete, consistent set of extents.

This means, after lvreduce -m 0, you should have a fully intact, consistent, single copy of the LV data on one disk, assuming no underlying device failures or other errors occur during the operation. Once you have a single copy, you can then create a new mirror in ‘strict’ mode, which enforces stricter synchronization and consistency guarantees between mirror legs, better suited for your DR scenario.

Regards,
Azr_geek