Operating System - HP-UX
1833873 Members
3197 Online
110063 Solutions
New Discussion

problem about faied disk replace

 
SOLVED
Go to solution
stephen peng
Valued Contributor

problem about faied disk replace

dear all,
I've got a problem when a replace a failed disk of vg00(consisted of c0t0d0 and c1t9d0). here was my steps:
1,replace the failed disk
2,mv /etc/lvmtab /etc/lvmtab.bak
3,pvcreate -B /dev/rdsk/c0t0d0
4,mv /etc/lvmtab.bak
5,vgcfgrestore -n /dev/vg00 /dev/rdsk/c0t0d0
then i got error messages:
vgcfgrestore: Cannot restore Physical Volume "/dev/dsk/c0t0d0",
Detach the PV or detactivate the VG, before restoring the PV.
finally I use lvreduce and vgreduce to complete the replace procedure.
could you please explain why i encountered that error.

thanks a lot
15 REPLIES 15
rariasn
Honored Contributor

Re: problem about faied disk replace

Hi Stephen:

Take a look at this document from HP:

http://docs.hp.com/en/5991-1236/When_Good_Disks_Go_Bad_WP.pdf

rgs,
Viktor Balogh
Honored Contributor

Re: problem about faied disk replace

Hi,

The error message is because you should have either done a "pvchange -a N" to the disk to detach/deactivate it or a "vgchange -a n" to deactivate the whole volume group.

Regards,
Viktor
****
Unix operates with beer.
Torsten.
Acclaimed Contributor
Solution

Re: problem about faied disk replace

Steps are wrong or in a wrong order.

Why you move lvmtab around???


Better to follow the steps in the when_good_disks ... document.



>> vgcfgrestore: Cannot restore Physical Volume "/dev/dsk/c0t0d0",
Detach the PV or detactivate the VG, before restoring the PV.



You get this because the disk was not disabled for LVM access

# pvchange -a n /dev/...

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
stephen peng
Valued Contributor

Re: problem about faied disk replace

Torsten,
If I did not mv lvmtab first and then pvcreate c0t0d0 and then mv vmtab back, I would not able to pvcreate c0t0d0 since lvmtab recognize it as configured at vg00. consider not encounter such situation with vg00, it would not need such steps,right?
is pvchange -a n availalbe at 11.11?
rariasn
Honored Contributor

Re: problem about faied disk replace

Hi Stephen:

> is pvchange -a n availalbe at 11.11?

Yes.

/usr/sbin/pvchange [-A autobackup] -a availability pv_path

rgs,
likid0
Honored Contributor

Re: problem about faied disk replace

To use online disk replacement(pvchange -a N disk) you need:

For 11.11: Patches PHKL_31216 and PHCO_30698 (or superseding patches)


Replacing a Mirrored Disk

In the event you need to replace a nonfunctional mirrored disk, you should perform the following steps to ensure that the data on the replacement disk are both synchronized and valid:

1.

Before replacing the disk, minimize any potential loss of data due to its removal; confirm that any mirrored logical volumes using the disk are mirrored onto a separate disk and that those mirror copies are current. You can find the list of logical volumes using the disk using pvdisplay:

pvdisplay -v /dev/dsk/cntndn

For each of those logical volumes, you can use lvdisplay to check which logical extents are mapped onto the disk, and if thereâ s a current copy of that data on another disk, as discussed in â Synchronizing a Mirrored Logical Volumeâ :

lvdisplay -v /dev/vol_group/lvoln | grep /dev/dsk/cntndn
2.

Run vgcfgbackup to save the volume group configuration information, if necessary:

vgcfgbackup /dev/vol_group

3.pvchange -a N /dev/dsk/cxtxdx




Physically disconnect the bad disk and connect the replacement.
5.

If you are replacing a mirror of the boot disk, set up the boot area on the disk.
1.

If this is an HP Integrity Server, partition the disk using the idisk command, as described in â Mirroring a Boot Disk with LVM on HP-UX 11i for HP Integrity Serversâ . You do not need to run insf or pvcreate, since you are replacing an existing physical volume.
2.

Use the mkboot command to set up the boot area:

mkboot /dev/rdsk/cntndn

On HP Integrity Servers, use the -e and -l options to the mkboot command to copy EFI utilities to the EFI partition:

mkboot -e -l /dev/rdsk/cntndn
3.

Update the root volume group information:

lvlnboot -R /dev/vg00
6.

Run vgcfgrestore to restore LVM configuration information to the added disk:

vgcfgrestore -n /dev/vol_group /dev/rdsk/cntndn
7.

Run vgchange -a y to reactivate the volume group to which the disk belongs. Since the volume group is already currently active, no automatic synchronization occurs:

vgchange -a y /dev/vol_group
8.

If any of the logical volumes on the disk had a nondefault timeout assigned, restore the previous timeout:

lvchange -t value /dev/vol_group/lvoln
9.

Now run vgsync to manually synchronize all the extents in the volume group:

vgsync /dev/vol_group
Windows?, no thanks
stephen peng
Valued Contributor

Re: problem about faied disk replace

rariasn,
I have tried executing pvchange -a N on my 11.11, but it failed.
Daniel,
in my replacing steps, i move lvmtab so I could execute pvcreate -B, do you mean that I don't need to remove lvmtab to pvcreate -B if I run pvchange -a N?
Torsten.
Acclaimed Contributor

Re: problem about faied disk replace

There is never a need to remove lvmtab while replacing a bad disk.


There is also no need to pvcreate the new disk, because you have to use vgcfgrestore.

In order to do this, you need to deactivate LVM access (pvchange -a n ...) first.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
chris huys_4
Honored Contributor

Re: problem about faied disk replace

Hi Torsten,

> There is never a need to remove lvmtab
> while replacing a bad disk.
>
> There is also no need to pvcreate the new
> disk, because you have to use
> vgcfgrestore.

> In order to do this, you need to
> deactivate LVM access (pvchange -a n ...) > first.
The "pvchange -a n" is only true when the necessary "olr" patches were installed, PHCO_30698, PHKL_30218 and PHKL_31216, which got introduced on hp-ux 11.11.

Probably the above patches have allready been superseeded a number of times by newer patches.

And from stephen reply, these patches, old as they are, doesnt seem to be installed on the system, so then the old and tried procedure of lvreduce and vgreduce is still the only valid one..

Greetz,
Chris
Torsten.
Acclaimed Contributor

Re: problem about faied disk replace

You assume the patches are not installed.

>> I have tried executing pvchange -a N on my 11.11, but it failed.



... but failed ...


What exactly failed?
Any error message?
What was the command?

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
chris huys_4
Honored Contributor

Re: problem about faied disk replace

> You assume the patches are not installed.

Its occams? razor. ;)
stephen peng
Valued Contributor

Re: problem about faied disk replace

Torsten,
>>There is never a need to remove lvmtab while replacing a bad disk.
There is also no need to pvcreate the new disk, because you have to use vgcfgrestore

you meant that vgcfgrestore would make the new disk bootable?

regards
stephen
Viktor Balogh
Honored Contributor

Re: problem about faied disk replace

>you meant that vgcfgrestore would make the new disk bootable?

no, vgcfgrestore only creates the LVM header on the disks. you should manually make it bootable.
****
Unix operates with beer.
Torsten.
Acclaimed Contributor

Re: problem about faied disk replace

vgcfgrestore does the same as pvcreate does in this situation (and more). It restores the previous configuration to the disk.

The boot area is still empty, so you need to do the mkboot and lvlnboot commands.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
stephen peng
Valued Contributor

Re: problem about faied disk replace

thank you all!