Operating System - HP-UX
1838196 Members
3912 Online
110125 Solutions
New Discussion

Break Mirror, Replace Disk, and Re-sync How

 
SOLVED
Go to solution
Basheer_2
Trusted Contributor

Break Mirror, Replace Disk, and Re-sync How

Greetings

/u is on /dev/vg01/lvol3, /dev/dsk/c0t5d0 (I think Internal Disk)

Critical software and appls are in this. Runs 7x24x365 (Almost)
Only /u on this now. all others file sys are moved out.

This is mirrored to /dev/dsk/c1t9d0 (Hot pluggable External Disk)

Q1) Can I break mirror, i.e want to take out /dev/dsk/c0t5d0
and replace with a new disk. How to do this.

Q2) After Replace, How to re-sync with /dev/dsk/c1t9d0
14 REPLIES 14
Helen French
Honored Contributor

Re: Break Mirror, Replace Disk, and Re-sync How

Q1) You can break the mirror by using lvreduce -m 0 command. Specify the disk when reducing (/dev/dsk/c0t5d0) and that will free that disk. Remove that disk from VG with vgreduce command or SAM.

Q2) Your /u will be working on a single disk now. Add the new disk, add it to the vg (vg01) with vgextend command. Once extended, mirror it back with:

# lvextend -m 1 lvol_name pv_path

Now check the status with lvdisplay -v command.
Life is a promise, fulfill it!
Pete Randall
Outstanding Contributor

Re: Break Mirror, Replace Disk, and Re-sync How

You need to take a look at The HP-UX Software Recovery Handbook:
http://www2.itrc.hp.com/service/iv/node.do?node=prod%2FWW_Start%2FN1%7C16

In particular, look at Chapter 16 on LVM, and the section on "Replacing a Failed Disk".


Pete

Pete
S.K. Chan
Honored Contributor
Solution

Re: Break Mirror, Replace Disk, and Re-sync How

You don;t have to break the mirror. First of all perform a full backup on all you lvols in vg01 (just in case). Then all you need to do is shutdown you system, replace c0t5d0 with another disk (make sure scsi id remains the same), then bring the system up in single user mode.
ISL> hpux -is (;0)/stand/vmunix
Now the recovery ..
# ioscan -fnC disk
==> Check to make sure the disk is there (assuming cXtXd0).
# pvcreate -f /dev/rdsk/cXtXd0
# vgcfgrestore -n /dev/vg01 /dev/rdsk/cXtXd0
# vgchange -a y /dev/vg01
# vgsync /dev/vg01
# shutdown -r 0
That's all ..
Helen French
Honored Contributor

Re: Break Mirror, Replace Disk, and Re-sync How

Again, since you are replacing an internal and non hotswap disk, you need to shutdown the system. Make sure you take a good backup and recovery tape.
Life is a promise, fulfill it!
Marco Santerre
Honored Contributor

Re: Break Mirror, Replace Disk, and Re-sync How

Hi,

to break the mirror is fairly easy as you just have to type on command :
#lvreduce -m 0 /dev/vg01/lvol3 /dev/dsk/c0t5d0

that will place your file system onto one disk (c1t9d0). Once you have changed your disk, you can re-sync using :
#lvextend -m 1 /dev/vg01/lvol3 /dev/dsk/c0t5d0

I would, however, be very cautious since c0t5d0 is internal. The fact that this disk is internal, I would recommend shutting down the machine before even attemping to remove this drive and replacing it.
Cooperation is doing with a smile what you have to do anyhow.
Massimo Bianchi
Honored Contributor

Re: Break Mirror, Replace Disk, and Re-sync How

Hi, in addition to Wilson comment: be sure that the new disk is the same capacity of the previous, or that your vg can support larger disks (PE per PV), otherwise you may not see any new capacity.

Remember that the mirrrong can take much time.

HTH,
Massimo
Uday_S_Ankolekar
Honored Contributor

Re: Break Mirror, Replace Disk, and Re-sync How

Since it's a internal disk , you will have to shutdown the box.

-Take backup of /u
-shutdown the box and replace the disk.
-vgcfgrestore -n /dev/vg01 /dev/dsk/newdisk vgchange -a y /dev/vg01 and then vgsync /dev/vg01

No need to lvreduce or break the mirror.

Good luck
-USA..
Good Luck..
Basheer_2
Trusted Contributor

Re: Break Mirror, Replace Disk, and Re-sync How

Thanks all.

Can I do this on-line. i.e when users are using this anytime. Does it matter when I do this.

I prefer breaking the mirror (this way int disk will be no longer used). Make sure everything is OK.

If problems, I can add back to vg01.

Wait for sat/sun then schedule replace.
Helen French
Honored Contributor

Re: Break Mirror, Replace Disk, and Re-sync How

For the last question: As I said before, since you are going to replace an internal non hot swappable disk, you will need to shutdown the system. You cannot do this online when the server is working!
Life is a promise, fulfill it!
Basheer_2
Trusted Contributor

Re: Break Mirror, Replace Disk, and Re-sync How

Hey Shiju

For Breaking the mirror, can I do this any time

I understand, for Replacing I need to take sys down
S.K. Chan
Honored Contributor

Re: Break Mirror, Replace Disk, and Re-sync How

Yes you can break the mirror while the system is running. The reason I don;t do it is because if the disk is severely damaged you may end up having to deal with "ghost disk" if the lvreduce and vgreduce operation failed. To break the mirror ..
# lvreduce -m 0 /dev/vg01/lvol3 /dev/dsk/c0t5d0
==> If this is successful run the vgreduce next.
# vgreduce /dev/vg01 /dev/dsk/c0t5d0
==> Check it with ..
# vgdisplay -v vg01
If for the above complains at some point you may have to force the removal of missing PV with ..
# vgreduce -f vg01
Helen French
Honored Contributor

Re: Break Mirror, Replace Disk, and Re-sync How

Yes, breaking the mirror can be done when online and users logged in. For replacing you need to shutdown the system.

I would do both at the same time since I need to reboot the system anyway. What will be the benefit to break the mirror first and keep that disk unused for some days? So to reduce risk, I would do both after shutting down.
Life is a promise, fulfill it!
Dave Wherry
Esteemed Contributor

Re: Break Mirror, Replace Disk, and Re-sync How

When you say it's an internal disk, internal on what kind of system? If it is a newer rpxxxx system you can hot swap it and do your entire procedure with the system up. If it is an older system like a K or a D, etc... you will need to shutdown.
Paula J Frazer-Campbell
Honored Contributor

Re: Break Mirror, Replace Disk, and Re-sync How

HI

Please assign points- as you have mentioned this thread in forum successes


Paula
If you can spell SysAdmin then you is one - anon