1842294 Members
2880 Online
110188 Solutions
New Discussion

restore failed disk

 
SOLVED
Go to solution
Dagmar Boelen
Frequent Advisor

restore failed disk

Hi,

Currently I am trying to determine a restore strategy for one of our mirrored machines.

My current plan, in case one of these disks fails, is to do a pvcreate on the newly installed disks. Deactivate the volumegroup, export the volumegroup and do a vgreduce. After that I do vgextend with the new installed disk. After this I should do a vgsync and after this procedure all should be fine.

Please comment one this procedure. Last question is about vgcfrestore. Someone advised me to use it in the restoreprocedure. What does it do? Someone told me it should do the same as all the steps above.

5 REPLIES 5
James R. Ferguson
Acclaimed Contributor

Re: restore failed disk

Hi David:

You need to read the disk recovery section in chapter-16 (LVM) of the "HP-UX Software Recovery Handbook" found in the ITRC Knowledge Tree:

http://www2.itrc.hp.com/service/iv/docDisplay.do?docId=/DE_SW_UX_swrec_EN_01_E/LVM.pdf

Not only does this address the correct procedure (hot-swp/no hot-swap disk; mirror/non-mirrored) but it discusses the use of 'vgcfgrestore'.

Regards!

...JRF...

Helen French
Honored Contributor
Solution

Re: restore failed disk

All you have to do is to replace the mirror disk, do a vgcfgrestore, do a vgchange -a y and check the lvdisplay and vgdisplay. If any mirror extents are in stale, do a lvsync and vgsync:
# vgcfgrestore -n [volume group name] /dev/rdsk/cXtYdZ
# vgchange -a y [volume group name]
# lvdisplay -v lv_name | more
# vgsync vg_name
# lvsync lv_name
Life is a promise, fulfill it!
Patrick Wallek
Honored Contributor

Re: restore failed disk

If you have a disk fail that is purely a data disk (NOT a boot disk) all you need to do is:

1) remove bad disk (assumes hot swap disk)
2) insert new disk (assumes hot swap disk)
3) pvcreate -f /dev/rdsk/c?t?d? - pvcreate new disk
4) vgcfgrestore -n /dev/vg?? /dev/rdsk/c?t?d? - restores vg configuration to the new disk
5) vgchange -a y /dev/vg?? - reactivates VG
6) vgsync vg?? - Syncs VG

There is not reason whatsoever to do a vgreduce on a vg when replacing a disk. In fact, a vgreduce may fail since the bad disk is not accessible.

James R. Ferguson
Acclaimed Contributor

Re: restore failed disk

Hi (again )Dagmar:

My apologies, Dagmar. I addressed you as "David", erroneously.

I should also add for your information, that 'vgcfgbackup' runs by default, every time you execute an LVM command. 'vgcfgbackup' saves the LVM header information (written to every disk in a volume group) in a file for possible use by 'vgcfgrestore'. More information can be found, to, in the man pages for 'vgcfgbackup' and 'vgcfgrestore'.

Regards!

...JRF...
A. Clay Stephenson
Acclaimed Contributor

Re: restore failed disk

The procedure varies a bit depending upon whether or not it is a boot disk. In either case, it is NOT necessary (or desired) to do a pvcreate. These are the two procedures but this does assume that all LVOL's on the disk ARE MIRRORED.

Assume the disk is c2t5d0 in vg01.

If NOT a boot disk:

vgcfgrestore -n /dev/vg01 /dev/rdsk/c2t5d0
vgchange -a y /dev/vg01
vgsync /dev/vg01

Assume the disk is c2t5d0 in vg00 and IS a mirrored boot disk:

vgcfgrestore -n /dev/vg00 /dev/rdsk/c2t5d0
vgchange -a y /dev/vg00
mkboot /dev/rdsk/c2t5d0
mkboot -a "hpux -lq (;0)/stand/vmunix" /dev/rdsk/c2t5d0
lvlnboot -R
vgsync /dev/vg00

Note that if you always use hot-plug disks there is absolutely no reason to shutdown.

If you are on support, download document ID KBAN00000347. It covers all the permutations of disk replacement.
If it ain't broke, I can fix that.