1829549 Members
2148 Online
109992 Solutions
New Discussion

Replace Disk (PV/VG/LV)

 
SOLVED
Go to solution
Laurent Paumier
Trusted Contributor

Replace Disk (PV/VG/LV)

Hello,
I must replace a disk on a HP-UX Name B.11.00 U 9000/800.
The disk is the c7t1d0.
It's a member of the PVGroup PVG1B. This PVG1B is member of the unique VG VG01.
Some logical volumes are stale. (Volumes integrating c7t1d0). LVOL stale have a mirror copie.

After having replaced the disk, which are the operations to be made ? pvXXX, vgXXX, lvXXX ?

Thank you very much.

# vgdisplay -v
--- Volume groups ---
VG Name /dev/vg01
...
Total PVG 4
Total Spare PVs 0
Total Spare PVs in use 0

--- Logical volumes ---
LV Name /dev/vg01/lvol1
LV Status available/syncd
...
Used PV 2

LV Name /dev/vg01/lvol2
LV Status available/stale
...
Used PV 20

LV Name /dev/vg01/lvol3
LV Status available/stale
...
Used PV 20

--- Physical volume groups ---
PVG Name PVG1
...
PVG Name PVG1b
PV Name /dev/dsk/c7t0d0
PV Name /dev/dsk/c7t1d0
PV Name /dev/dsk/c7t2d0
PV Name /dev/dsk/c7t3d0
PV Name /dev/dsk/c7t4d0
PV Name /dev/dsk/c7t5d0
PV Name /dev/dsk/c7t6d0
PV Name /dev/dsk/c7t7d0
PV Name /dev/dsk/c7t8d0
PV Name /dev/dsk/c7t9d0

# lvdisplay /dev/vg01/lvol2
--- Logical volumes ---
LV Name /dev/vg01/lvol2
VG Name /dev/vg01
.
LV Status available/stale
Mirror copies 1
Consistency Recovery MWC
Schedule parallel
...
Stripes 0
Stripe Size (Kbytes) 0
Bad block on
Allocation PVG-strict/distributed
5 REPLIES 5
Devender Khatana
Honored Contributor
Solution

Re: Replace Disk (PV/VG/LV)

Hi,

Replace the disk and add another disk at the same ID/controller so that the device file is same and obviously the disk size also should be same only.

#vgcfgrestore -n /dev/vg01 /dev/rdsk/c7t1d0
#vgsync vg01

This should be able to do this.

Also have a lokk at this disk-replacement guide
http://docs.hp.com/en/5991-1236/When_Good_Disks_Go_Bad.pdf

HTH,
Devender
Impossible itself mentions "I m possible"
Arunvijai_4
Honored Contributor

Re: Replace Disk (PV/VG/LV)

Hello,

Check these threads for more information..

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=763059
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=124025

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Laurent Paumier
Trusted Contributor

Re: Replace Disk (PV/VG/LV)

Thanks for the answer and the pdf. ;)
Senthil Kumar .A_1
Honored Contributor

Re: Replace Disk (PV/VG/LV)

Hi,

Devender reply is spot on.

Just a point adder, in case you have added the disk to different scsi controller or its target ID was different, and the system recognizes it as a differnt device file(say c8t2d0), just do the following

vgcfgrestore -n /dev/vg01 -o /dev/rdsk/c7t1d0 /dev/rdsk/c8t2d0

Then syncronize the mirror,

vgsync vg01

The document which devender linked in the previous response, is indeed best, that could help you in such situations.

Regards,
Senthil Kumar .A
Let your effort be such, the very words to define it, by a layman - would sound like a "POETRY" ;)
Ajitkumar Rane
Trusted Contributor

Re: Replace Disk (PV/VG/LV)

Laurent,

As already suggested in the previous reply to do a vgcfgrestore, just an addon to it.

Preferably, the volume group should be made unavailable before executing vgcfgrestore by executing the command

vgchange -a n vg01

OR


Force to restore the LVM configuration data when volume group is still active
vgcfgrestore -R -n /dev/vg01 /dev/rdsk/c7t1d0


Rgds,

Ajit
Amidsts difficulties lie opportunities