Operating System - HP-UX
1832938 Members
2745 Online
110048 Solutions
New Discussion

Re: commands to replace mirrored copy of root disk

 
SOLVED
Go to solution
Richard Darling
Trusted Contributor

commands to replace mirrored copy of root disk

At noon today HP will replace the mirrored copy of my root disk. This is the first time I have had to do this. I searched the ITRC docs and forum and came up with many posts and docs, but am a little concerned about some discrepancies between them.

1) lvreduce - some docs say to do it and some don't. If I do this do I have to run the command for the vg00/lvol2 (swap)?

2) mkboot -a
One shows mkboot -a "hpux (:0)/stand/vmunix" /dev/rdsk/cntndn

Another shows mkboot -a "hpux" /dev/rdsk/cntndn

3) Lvlnboot - one shows it being run 4 times with the r,s,d and v options for each vol on the disk.
Another shows it being run twice, with the -R option then the -v.

I have read the man pages on these commands and would like some opinions.

Thanks.
Richard Darling



13 REPLIES 13
Patrick Wallek
Honored Contributor

Re: commands to replace mirrored copy of root disk

Richard,

Check out this thread. JRF's answer gives you the exact steps and these work quite well. There's absolutely no need to lvreduce the disk out of the mirror.

http://forums.itrc.hp.com/cm/QuestionAnswer/1,1150,0xf890abe92dabd5118ff10090279cd0f9,00.html
A. Clay Stephenson
Acclaimed Contributor

Re: commands to replace mirrored copy of root disk

Hi Richard:

I would make one change (or actually a supplement) to James' recipe:

After you are done with the replacement, on the remaining boot disk, do this:
mkboot -a "hpux - /stand/vmunix" (;0)/dev/rdsk/CXtYdZ

This way you can boot the machine off of either disk without having to assert quorum.
If this command is run on both ofd your boot disks then anybody can boot your machine without intervention.

If it ain't broke, I can fix that.
Sanjay_6
Honored Contributor

Re: commands to replace mirrored copy of root disk

Hi Richard,

You have to proceed like this.

don't do any lvreduce.

Shutdown your system, replace the failed disk.

Boot your system using your working disk in single user mode. At the boot prompt interrupt the boot process, bo using your working disk and interact with ipl. At ipl prompt boot into single user mode with quorum disabled.
IPL>hpux -is -lq (;0)/stand/vmunix

It will boot into single user mode. Now do a mkboot for the new disk (say c?t?d?)

mkboot /dev/rdsk/c?t?d?
mkboot -a "hpux -lq (;0)/stand/vmunix" /dev/rdsk/c?t?d?
mount -a
(do this so that it mounts other lv for vg00)
(if they don't get mounted, mount them manually)
vgcfgrestore -n /dev/vg00 /dev/rdsk/c?t?d?
vgsync /dev/vg00

This should rebuild the mirror and your can reboot the system and work as usual.

Hope this helps.

thanks
Deshpande Prashant
Honored Contributor

Re: commands to replace mirrored copy of root disk

Hi
If you are able to shutdown the system, following steps will get you back the mirrors.

# Shutdown your system and replace the disk that is failing.
# Boot system into single user mode without quorum, as:
# ISL> hpux -is -lq /stand/vmunix

Restore volume group information on newly added disk.
# vgcfgrestore -n /dev/vg00 /dev/rdsk/cXtYdZ
# mkboot /dev/rdsk/cXtYdZ
#mkboot -a "hpux -lq /stand/vmunix"
/dev/rdsk/cXtYdZ

# lvlnboot -R
# vgchange -a y /dev/vg00

Synchronise the mirror volumes.
# vgsync /dev/vg00

Reboot the machine.
# shutdown -ry 0

Do confirm the miorror functionality by booting from mirror disk.

Update the diag information on mirror disks.
#mkboot -b /usr/sbin/diag/lif/updatediaglif2 -p ISL -p HPUX -p LABEL -p AUTO /dev/rdsk/cXtYdZ.


Thanks.
Prashant.


Take it as it comes.
Richard Darling
Trusted Contributor

Re: commands to replace mirrored copy of root disk

Hi Patrick,
I had read that thread...
what about the conflict with the lvlnboot command - does running it once with the -R option cover the other three, r,s,d?. And I don't need to run it for each lvol?
Thanks...better safe...
Richard Darling
Bernie Vande Griend
Respected Contributor

Re: commands to replace mirrored copy of root disk

The steps above are perfect. To clarify an answer to your questions:

1) no need for lvreduce at all. vgsync will take care of getting things in sync again.

2)Various boot commands would work, but I prefer the boot that overrides quorum:

mkboot -a "hpux -lq /stand/vmunix" /dev/rdsk/C?t?d?

3)You really just need one lvlnboot -R to sync the information between the disks again. The lvlnboot -v is just to check to make sure it looks right. The other lvlnboot options would only be used if you wanted to change one of the options.
Ye who thinks he has a lot to say, probably shouldn't.
Sanjay_6
Honored Contributor

Re: commands to replace mirrored copy of root disk

Hi Richard,

Have a look at the thread below for more detailed steps.

http://us-support.external.hp.com/cki/bin/doc.pl/sid=b2fe8f3f0a24cf7a44/screen=ckiDisplayDocument?docId=200000054531628

Hope this helps.

thanks
Richard Darling
Trusted Contributor

Re: commands to replace mirrored copy of root disk

Sorry Bernie, in my haste I gave you 6 points...meant it to be 8 points...
Richard

Re: commands to replace mirrored copy of root disk

The following lines we used to reconstruct the mirror-disk when we once installed the OS via an ignite tape. I think this is the same as replacing a disk.

The name of the volumes and devices must surely edited:


#!/bin/sh
# Recreate a mirror of the boot disk.
# Make sure the disk is removed from the group by using
# vgreduce. Alternatively you could edit the vg00
# definition to remove the references to this disk.
vgreduce /dev/vg00 /dev/dsk/c2t2d0

# Make the disk contain a boot area.
pvcreate -f -B /dev/rdsk/c2t2d0

# Add the mirrored disk back to the group.
vgextend /dev/vg00 /dev/dsk/c2t2d0

# Copy the boot area to the disk.
mkboot /dev/rdsk/c2t2d0
mkboot -a 'hpux -lq' /dev/rdsk/c2t2d0
mkboot -a 'hpux -lq' /dev/rdsk/c1t2d0

# Allocate the mirrors. Mirrors must be allocated for all
# logical volumes that were previously mirrored. This
# example illustrates primary swap and root. You should
# add others as needed.

lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c2t2d0
lvextend -m 1 /dev/vg00/lvol2 /dev/dsk/c2t2d0
lvextend -m 1 /dev/vg00/lvol3 /dev/dsk/c2t2d0
lvextend -m 1 /dev/vg00/lvol5 /dev/dsk/c2t2d0
lvextend -m 1 /dev/vg00/lvol4 /dev/dsk/c2t2d0
lvextend -m 1 /dev/vg00/lvol6 /dev/dsk/c2t2d0
lvextend -m 1 /dev/vg00/lvol7 /dev/dsk/c2t2d0
lvextend -m 1 /dev/vg00/lvol8 /dev/dsk/c2t2d0
lvextend -m 1 /dev/vg00/lvsamba /dev/dsk/c2t2d0

# Update the BDRA and the LABEL file.
lvlnboot -R

Richard Darling
Trusted Contributor

Re: commands to replace mirrored copy of root disk

Thanks to everyone for your help...all set.

Richard Darling
James Ellis_1
Super Advisor

Re: commands to replace mirrored copy of root disk

I am looking into setting up a mirrored root VG. Looking at the answers to the person who posted this questions, Patrick Wallek's JRF thread doesn't come up when I click on it. The replies all date around the end of Sept. Can someone tell me where I can find this Doc so I can read it? I don't have any materials on Root VG mirroring, so this threat may have some helpful insights. Thanks, Jim
"In the middle of difficulty lies opportunity" -Einstein
Richard Darling
Trusted Contributor

Re: commands to replace mirrored copy of root disk

James, Here is the essence of the "king's" response from my notes. I couldn't get that link to display the page today, either.
Richard Darling

Replace Mirrored Boot Disk
# Shutdown your system and replace the disk that is failing.
# Boot into single user mode and override the quorum, as:
# ISL> hpux -is -lq /stand/vmunix
# vgcfgrestore -n /dev/vg00 /dev/rdsk/cXtYdZ
# vgchange -a y /dev/vg00
# mount /usr
# mkboot /dev/rdsk/cXtYdZ
# mkboot -a "hpux -lq /stand/vmunix" /dev/rdsk/CXtYdZ
# lvlnboot -R
# lvlnboot -v #...to verify all is as desired...
# vgsync /dev/vg00
# shutdown -ry 0
James R. Ferguson
Acclaimed Contributor
Solution

Re: commands to replace mirrored copy of root disk

Hi Richard:

The recent ITRC maintenance *changed* links. The older links have the string "1.1150". Simply change that to "1,11866" and you will be able to retrace old replies. I have asked *repeatedly* for a conversion of existing threads!!!

Thus, my original post can be found here:

http://forums.itrc.hp.com/cm/QuestionAnswer/1,11866,0xf890abe92dabd5118ff10090279cd0f9,00.html

Regards!

...JRF...