1752644 Members
5568 Online
108788 Solutions
New Discussion юеВ

Mirror drives

 
James Odak
Valued Contributor

Mirror drives

Is there anyway of taking 2 mirrored drives and make the secondary one primary?
of course with out removing the mirror and re-mirroring of course

Thanks
Jim
8 REPLIES 8
Dave Wherry
Esteemed Contributor

Re: Mirror drives

If you lvreduce the number of mirrors and specify you primary, all you will be left with is the mirror. This of course makes the original useless for what you are asking. You could then lvextend and add the original back in as a mirror and it will remirror everything. Your primary and mirror will have traded places.

If I'm reading you correctly, I think lvsplit may work for you. It will split off the original leaving you on only the mirror. However, the original remains as a static copy. This is discussed in a document on the ITRC, ID # X1401978.
It deals with booting from a split mirror copy. I think most of it would apply to what I think you are trying to do.
Tim Malnati
Honored Contributor

Re: Mirror drives

Not without breaking it down and then remirroring (not a difficult or very time consuming evolution). But this begs the question, why?
Alan Riggs
Honored Contributor

Re: Mirror drives

I agree, why?

Are you experiencing heavy traffic on one controller? The primary link does get a bit more read traffic, though this only really matters if both disks are available when the request comes. If the primary is busy, then the system willread from the mirror copy.

Writes are, of course, equal to both drives.
Antoanetta Naghiu
Esteemed Contributor

Re: Mirror drives

1.If you are talking about root disk, and the mirror is bootable, just enable as a primary boot path the secondary disk and make the former primary the alternative one.
2. you can split it and remirror again (see above posts).
James Odak
Valued Contributor

Re: Mirror drives

ok whats happening is
we have a hitachi drive box with oh 64gig of drive space
we just purchased another box with 300+gig of drive space
what i need to do is take all the data from the set of drives and put it on the new
problem is the data on the old is already mirrored to the int drives (as the secondary)

we want the new drive box to act as primary mirrors and the int drives to remain as the secondary

Also, the powers that be want everyting mirrored correctly (with primary on the new drives) before we delete and disconnect the old drives

make sense?

so my plan was to mirror the drive to the new box, unmirror the the old mirrors on the int drives and re mirror those
leaving the old drive prime new drives second and int 3rd so when the old beox is removed the 2nd becomes prime and 3rd becomes 2nd

was wondering if there was an easier way of doing that

i hope i don't sound too clueless here
Tim Malnati
Honored Contributor

Re: Mirror drives

Mirrordisk supports multiple mirrors (primary & two secondaries). Here is what I would try:

vgextend the new array into the volume group and lvextend the third mirror into each logical volume. Use the physical disk parameter to make sure the third mirror establishes on the platter you expect. The old Hitachi should now be primary, the internals should be the first secondary, and the new Hitachi should be the second secondary.

lvreduce the internal drives from the logical volumes. Again, use the physical disk parameter to remove the appropriate internal disk from the mirrorset. My thinking here is that the new Hitachi drives should (??) become the first secondary at this point. Then lvextend the internal disks back into the mirror set. Hopefully they become the second secondary. The lvdisplay -v command should show the mirror relationships at this point.

lvreduce the old Hitachi drives from the group. The new Hitachi drives should (??) become primary and the internals should promote to the first seconday (hopefully). If all is well, vgreduce the old hitachi drives from the volume group.

As you can see, this is sort of theoretical. But I think it is worth a try where you are never in a situation with less than two drives attached to the data. If this doesn't work from a what's primary and what's secondary point of view, then you have no option than to break the mirroring down to the point where the new Hitachi's are the only drives in the logical volume prior to mirroring in the internal secondaries again.

Godd luck.
John Palmer
Honored Contributor

Re: Mirror drives

Provided you can unmount the filesystem or stop using the volume, you can swap the primary and secondary mirrors without the need to resync as follows:-
1. Unmount
2. lvsplit (creates b)
3. lvmerge b
4. cd /dev/vg???
5. mv b
6. mv rb r

Then remount the filesystem etc.

Regards,

John
James Odak
Valued Contributor

Re: Mirror drives

oh well i guess i should stop looking for shortcuts and jsut do it hehe
BTW i didnt metnion this server is used 24/7 and i can not unmount these FS's to do this

i was just looking for a shortcut
thanks for the advice tho

Jim