cancel
Showing results for 
Search instead for 
Did you mean: 

Replacing vg00`s boot disk

SOLVED
Go to solution
R.O.
Esteemed Contributor

Replacing vg00`s boot disk

Hi,

I am writing a standard procedure for replacing vg00's boot disks (mirrored and hot swappable). Based on the HP's doc "When good disks go bad" I have the following (for 11.11):


1º lvreduce -m 0 -A n /dev/vg00/lvol1 /dev/dsk/cXtXdX


2º vgreduce /dev/vg00 /dev/dsk/cXtXdX

3º pvchange -a N /dev/dsk/cXtXdX --> Is it necessary?

4º Replace disk and find it with ioscan

5º vgcfgrestore -n /dev/vg00 /dev/rdsk/cXtXdX

6º pvchange -a y /dev/dsk/cXtXdX or vgchange -a y /dev/vg00 ?

7º mkboot /dev/rdsk/cXtXdX

8º mkboot -a "hpux -lq" /dev/rdsk/cXtXdX

9º lvlnboot -R /dev/vg00

10º Check with lvlnboot –v


I have some doubts:

3º pvchange -a N /dev/dsk/cXtXdX --> Is it necessary? I think it is not, because you have stopping LVM access to the disk by reducing its mirror copies and reducing the vg00....

5º vgcfgrestore -n /dev/vg00 /dev/rdsk/cXtXdX --> Will this add the disk to vg00 and recreate the mirror copies? I think so, but need confirmation (i.e. I do not need to do vgextend nor lvextend -m 1 .... again for each logical volume)

6º pvchange -a y /dev/dsk/cXtXdX or vgchange -a y /dev/vg00 ? --> Which I have to use? Have I to wait until mirror copies are synchronized?

And for boot headers and the whole procedure, are all the needed steps in this procedure?

Regards,
"When you look into an abyss, the abyss also looks into you"
10 REPLIES
SoorajCleris
Honored Contributor

Re: Replacing vg00`s boot disk

3 - for stopping LVM access to that disk.

N Detach the given path and all other
paths to the physical volume. The
system administrator should always
presume that all the disks that
belong to an active volume group
are attached and may be used by LVM
at any time, unless LVM has been
specifically notified to detach
them. Prior to replacing or
repairing any disk belonging to an
active volume group, the
administrator must first detach the
PV using this command. When a PV
is detached, LVM closes all the
paths to the PV and no longer
directs any I/O operations to it.
If a suitable spare PV is available
in the volume group, LVM will use
it to reconstruct the detached
disk. The given path must be an
attached path to the PV, otherwise,
the command will fail and display
an error message indicating the
problem. If for any reason the use
of the -N N opton fails, the
physical volume can still be
detached from the volume group by
individually detaching each of the
paths to the physical volume using
the -a n option instead.


5º vgcfgrestore -n /dev/vg00 /dev/rdsk/cXtXdX --> Will this add the disk to vg00 and recreate the mirror copies? I think so, but need confirmation (i.e. I do not need to do vgextend nor lvextend -m 1 .... again for each logical volume)==> yes it will ,only thing you need to run vgsynch and lvsynch .

pvchange -a y /dev/dsk/cXtXdX or vgchange -a y /dev/vg00 ? --> Which I have to use? Have I to wait until mirror copies are synchronized?

with out changing it you will not be able to resynch it !!!
"UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity" - Dennis Ritchie
likid0
Honored Contributor

Re: Replacing vg00`s boot disk

If you are replacing and internal scsi disc, and it's HDW/path is not going to change you can skip reducing the mirror.

You can:


Replace de disk
ioscan the disk
vgcfgrestore -n /dev/vg00 /dev/rdsk/cXtXdX
vgsync /dev/vg00
mkboot...etc.

because in your procedure, you are making a backup of the vg00 here:

vgreduce /dev/vg00 /dev/dsk/cXtXdX

and when you restore it it's going to only have one disk, you need to:

vgreduce -A n /dev/vg00 /dev/dsk/cXtXdX



3º pvchange -a N /dev/dsk/cXtXdX --> Is it necessary? If you reduce the mirror, you don't need it.

5º vgcfgrestore -n /dev/vg00 /dev/rdsk/cXtXdX --> Will this add the disk to vg00 and recreate the mirror copies?
only if the lvm backup copy had the 2 disks with a mirror
to sync:
vgsync /dev/vg00 just in case

6º pvchange -a y /dev/dsk/cXtXdX or vgchange -a y /dev/vg00 ? --> Which I have to use?
If you use pvchange -a N, then you need to use pvchange -a y once the disk has been replaced
Windows?, no thanks
R.O.
Esteemed Contributor

Re: Replacing vg00`s boot disk

Hi,

I understand what you say about "vgreduce -A n /dev/vg00 /dev/dsk/cXtXdX" but then the document "When good disks go bad" (lots of people point to this docs when questioned about replacing disks) is wrong ! Is it possible ? In this doc they tell you to "vgreduce /dev/vg00 /dev/dsk/cXtXdX" and afterwards, "vgcfgrestore -n /dev/vg00 /dev/rdsk/cXtXdX"
Also, this doc do not say anything about "vgsync" or "lvsync". It only talks about "pvchange -a y" and "vgchange -a y". I am getting a bit confused.
"When you look into an abyss, the abyss also looks into you"
likid0
Honored Contributor

Re: Replacing vg00`s boot disk

In this doc they tell you to "vgreduce /dev/vg00 /dev/dsk/cXtXdX" and afterwards, "vgcfgrestore -n /dev/vg00 /dev/rdsk/cXtXdX"
Nah, in the doc it can't be wrong, i'll test it out.


Also, this doc do not say anything about "vgsync" or "lvsync". It only talks about "pvchange -a y" and "vgchange -a y". I am getting a bit confused.

pvchange -a y <--- you activate access to the pv, if you previously did a pvchange -a N

vgchange -a y <---- does a backgroung vgsync, so if you do a vgchange -a y vg00 you don't need to also do a vgsync
Windows?, no thanks
R.O.
Esteemed Contributor

Re: Replacing vg00`s boot disk

"In this doc they tell you to "vgreduce /dev/vg00 /dev/dsk/cXtXdX" and afterwards, "vgcfgrestore -n /dev/vg00 /dev/rdsk/cXtXdX"
Nah, in the doc it can't be wrong, i'll test it out."

Ok, I cannot do such test, if you can do it, please, let me know the results. I think it will work...

Thank you very much!

Regards,
"When you look into an abyss, the abyss also looks into you"
SoorajCleris
Honored Contributor

Re: Replacing vg00`s boot disk

This document is correct .
There is no chance of doubt,
You can proceed with the procedure ..
"UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity" - Dennis Ritchie
ankitj1983
Frequent Advisor

Re: Replacing vg00`s boot disk

Hi,

Reducing the mirror is required when your disk not completely dead bcz to avoid data corruption.If disk is completely dead then you can directly replace the disk.


Regards

Ankit
R.O.
Esteemed Contributor

Re: Replacing vg00`s boot disk

So, if the disk is not dead, Can I use this?:

# pvchange -a N /dev/dsk/cXtXdX
- Replace disk and find it with ioscan
# vgcfgrestore -n /dev/vg00 /dev/rdsk/cXtXdX
# pvchange -a y pvname

or it is better to reduce mirror and vg?
This is my doubt, because there are these two methods and the first one is easier and faster.
"When you look into an abyss, the abyss also looks into you"
likid0
Honored Contributor
Solution

Re: Replacing vg00`s boot disk

As long as you have one current mirror copy on one disk, you can use replace.

You can check the case scenarios, case number 1 on the when good di... document.

HP support techs normally just replace the disk,sync,mkboot part. It's much faster this way.
Windows?, no thanks
R.O.
Esteemed Contributor

Re: Replacing vg00`s boot disk

Yes, the "Disk replacement flowchart" of the doc clarify the thing: if the disk is hot-swappable, all the lvols are mirrored and there is "LVM OLR", it directly drives you to "pvchange -a N" and "vgcfgrestore". Only if "LVM OLR" is not present, it tells you to "lvreduce/vgreduce". I think I should have read this flowchart before posting my doubts ;)

Thank you very much for your time and best regards !
"When you look into an abyss, the abyss also looks into you"