Operating System - HP-UX
1755101 Members
1527 Online
108829 Solutions
New Discussion юеВ

switching disk looking for the best way.

 
SOLVED
Go to solution
Scott_14
Regular Advisor

switching disk looking for the best way.

Hello:

I am wander what is the best way, to switch 2 drives I have that are mirrored, with 2 other drives with minimal downtime.
I have 2 18gig drives that are mirrored, say A-?B, which were "borrowed", and I need to pull them back out, and the data will be basically put on 2 new drives which is on our SAN..say C-?D

I have a few thoughts on this but was hoping to get some feed back on the best way.
I am not sure if I can assigned the new drive C to the same volume group of vg04, then just do a pvmove from A to---C then mirror C-?D and remove the drives containing A--B.
Or add a 3rd mirror, say B-?C, then some how remove A, and Mirror C-?D, then remove B, kind of like just do some mirroring to the new drives, and remove the old ones, that way I can keep things up.


Thank you in advance for your feed back.
scott
8 REPLIES 8
John Palmer
Honored Contributor
Solution

Re: switching disk looking for the best way.

Providing your new drives are not too large to be accomodated by the volume group's Max PE per PV then the easiest solution is what you suggested:-

Add new disks C and D to the VG
pvmove A to C
pvmove B to D
Remove A and B from the VG.

If the disks are too big then you will have to create a new VG for them, create new mirrored filesystems and physically copy your filesystems from A/B to C/D. This will require application downtime though.

Regards,
John
Scott_14
Regular Advisor

Re: switching disk looking for the best way.

thank you...

I am wandering on the pvmove of B--D,
if i move that first mirror, A--->C, should I then just do a mirror from C-->D, then remove a,b?

John Palmer
Honored Contributor

Re: switching disk looking for the best way.

I would pvmove B to D.
The alternatives are:-

lvreduce the mirror from B then lvextend onto D. This does the same thing as pvmove but has the disadvantage of leaving you with only one mirror copy for a short time.

Create a third mirror on D then lvreduce from B. No real advantage and it's two commands instead of one.

Regards,
John
John Waller
Esteemed Contributor

Re: switching disk looking for the best way.

There is another way other than using pvmove but it is a lot more risky and depends if the disks are "Hot Swap" are not.

Since the disks are mirrored you could remove one disk as if it was faulty then add the a replacement. pvcreate and vgcfgrestore would automatically resync it all. Once re-synced , do the same with the second disk.
As I have said high risk as the remaining disk could fail whilst you are changing the disks but ast least you don't have to worry about adding extra disks to the VG then performing a vgreduce to remove from the VG when finished.
Scott_14
Regular Advisor

Re: switching disk looking for the best way.

Well, I guess im asking a lot of questions cause the system is a critical one.

One other option i am thinking of is,
taking the mirrored a-->b, and creating a 3rd mirror to C
then reducing out a, then mirroring c-->d, then reducing out b, leaving me with the end result the replacement drives c--->d and be happy?

I guess i am thinking mirroring, since when the disk a,b
were borrowed, and disk a was being mirrored to b, it only took approx 30 min. Does this sound like it would work? Or is the pvmove a much better way to go?

scott

Mike Shilladay
Esteemed Contributor

Re: switching disk looking for the best way.

Hi Scott,

Without going over ground previously covered, the way you suggest would work, it also provides extra resillience in the fact that should any one disk fail you still have your data covered + a mirror copy. If you use this approach make sure that you unmirror the right disk. This is where pvmove has the advantage that you just need to know the source and destination disks, so the pvmove is probabaly less arduious than the mirror way.

Hope this helps,

Mike.
Peggy Fong
Respected Contributor

Re: switching disk looking for the best way.

Scott

I agree, adding the 3rd mirror is easy. When you lvreduce don't forget to specify the disk you want removed.

Someon (John?) mentioned that you can only do this if the new disks are not too large for your volume group. You do not want to add an 18G disk to a volume group that only has 2gb disks especially if you did not specify a high max PE size to accommodate this. If the Max PE is too small, then you will not be able to use the whole disk. You would need to create new VGs on the new disks to use all the PEs.

If you do this, one way to move your data over is at the least active time you can "dd" each raw lvol from the old disk to the new disk. fsck the new, mount and compare. But then you would need down time to unmount the old and mount the new and change fstab. You may even need down time to do the dd command to ensure data integrity.

So I hope your Max PE is set high enough to do what you want with the mirroring -

Peggy
Scott_14
Regular Advisor

Re: switching disk looking for the best way.

Thank you for all the replies, and good feed back. I guess I get pretty cautious, when I have to deal with some critical.

I am leaning twards using a 3rd mirror to the newer drive, even though it may be an extra step, but with the correct planning, it should be ok. Thank you again