Operating System - HP-UX
1748181 Members
4026 Online
108759 Solutions
New Discussion юеВ

Replacing a failed mirrored root disk online

 
SOLVED
Go to solution
akg_1
New Member

Replacing a failed mirrored root disk online

Hello all,
I had gone through the steps for
"replacing a failed mirrored root disk" posted by different members of this forum.
I would like to clarify the below :
1) Someone says after replacing the disk, do a "pvcreate" on the new disk and then "vgcfgrestore" and next steps (vgchange,vgsync etc )
2)Others say replace the disk, do a vgcfgrestore ( NO pvcreate) and next steps (vgchange,vgsync etc )

So which one is correct ? ( OR both are correct ? )

Will LVM allow to do a pvcreate as the disk entry is already there in /etc/lvmtab under vg00 ?( I am using a disk with same target number)
If the answer is NO, then I am again confused as the man page for pvcreate says "Disks cannot be added to a volume group until they are properly initialized by pvcreate "
All responses are appreciated
5 REPLIES 5
Matti_Kurkela
Honored Contributor
Solution

Re: Replacing a failed mirrored root disk online

Look at the HP's official word about disk replacement:
http://docs.hp.com/en/5991-1236/When_Good_Disks_Go_Bad.pdf

(Chapter 6 is about replacing a failed disk. Note that chapter 5 is about removing a failed disk when you *don't* intend to replace it.)

The essential question is, did you use lvreduce and/or vgreduce before removing the failed disk or not?

(If your OS version and patchlevel is such that you have the LVM OLR functionality available, you can prevent the LVM from accessing the disk while you're replacing it with "pvchange -a N". If your OS is so old it does not have this facility, you should lvreduce & vgreduce the failed disk out of its volume group before hot-unplugging the actual disk.)

If you did lvreduce & vgreduce the disk out of VG configuration before replacing the disk, "vgcfgrestore" is not going to do anything useful, as the saved configuration will not include this disk anymore. You must proceed just like when mirroring a root disk for the first time:
- "pvcreate" to make the new disk a LVM disk (don't forget the -B option for PA-RISC root disks!)
- "mkboot" to install the bootloader (the boot area is outside the LVM area, so it is not mirrored automatically)
You might install the off-line diagnostics to the boot area too, if you use them.
- "vgextend" to join the disk to the volume group
- "lvextend -m 1" to mirror each logical volume
- "lvlnboot" to update the LVM boot configuration

If you did not lvreduce & vgreduce before replacing the disk, you can use vgcfgrestore.
In this case, vgcfgrestore will make the new disk configured exactly the same as the original was (from the LVM viewpoint): the VG membership and the mirror configuration of each LV will be restored to the new disk. However, the actual data will still be (extremely) out of sync: vgcfgrestore will restore just the LVM configuration, not the data.

After the vgcfgrestore, you must enable LVM access to the disk with "pvchange -a y" (if it was disabled either manually or automatically because of the disk failure).
After that, the LVM should automatically start synchronizing the LVs. If that does not happen, you can use "vgsync" or "lvsync" to force the synchronization.

The boot area must also be restored independently of LVM, just as above.
You should be able to run "mkboot" at any time after the vgcfgrestore, but the "lvlnboot" should be run only after the three boot-critical LVs (lvols 1-3: /stand, swap and root) have completed synchronization.

MK
MK
MHudec
Frequent Advisor

Re: Replacing a failed mirrored root disk online

All was said already, I will just add - if that is itanium system, then do not forget about partitioning the drive (idisk, three partitions) and also about the fact, that lvm works with cXtYdZs2 partition and not the whole cXtYdZ as is on parisc systems.
Steven E. Protter
Exalted Contributor

Re: Replacing a failed mirrored root disk online

Shalom,

Note that many newer Itanium systems offer hardware raid cards. If your system is configured with hardware raid, you need to merely replace the disk.

I believe that which of your two steps in a software raid scenario are correct depends on what your response was when the disk went bad.

If you caught it before it died and split the mirrors then you start with pvcreate and don't do vgcfgrestore at all.

More commonly the pvcreate/vgcfgrestore path is what needs to be done because the disk was totally dead before any action was taken.

pvcreate is needed to prepare the disk for any use t all. Option 2 will fail if pvcreate is required. Then go with option 1. I always go for some version of option 1. preparing the disk never hurts even if technically not needed.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
skt_skt
Honored Contributor

Re: Replacing a failed mirrored root disk online

here is what i do and always work well.

To list and verify the config file

root [/root] vgcfgrestore -n /dev/vg00 -l
Volume Group Configuration information in "/etc/lvmconf/vg00.conf"
VG Name /dev/vg00
---- Physical volumes : 2 ----
/dev/rdsk/c0t0d0 (Bootable)
/dev/rdsk/c3t0d0 (Bootable)

mkboot /dev/rdsk/c0t0d0

mkboot -b /usr/lib/uxbootlf /dev/dsk/c0t0d0
Pvchange -a n /dev/dsk/c0t0d0
vgcfgrestore -F -n vg00 /dev/rdsk/c0t0d0
Pvchange -a y /dev/dsk/c0t0d0
vgchange -a y vg00
vgsync vg00

lvlnboot -R

for lif_comp in `lifls /dev/dsk/c3t0d0`
do
/usr/bin/lifcp /dev/dsk/c3t0d0:${lif_comp} /dev/dsk/c0t0d0:${lif_comp}
akg_1
New Member

Re: Replacing a failed mirrored root disk online

Thank you for your responses
I am aware of the official procedure to replace the disk (lvreduce,vgreduce,pvcreate......) and also about the "idisk" partitioning on itanium servers

But I am confused about the procedures suggested by different forum members as I said first
The situation is that Disk is completely dead and hot swappable and no OLR is installed

Someone in this forum said to unplug the disk and straight away do a "vgcfgrestore" followed by next steps
While others said to do a "pvcreate -fB" first and then "vgcfgrestore" followed by next steps
So my question is, in the above situation a pvcreate is possible or NOT as the disk entry is already there in /etc/lvmtab ?
and if pvcreate is not required, is it going to work ?