Operating System - HP-UX
1830901 Members
2069 Online
110017 Solutions
New Discussion

Replace disk in mirror VG

 
SOLVED
Go to solution

Replace disk in mirror VG

Hello,

One of the hard disks in mirrored VG has died. I have replaced it online with other same size disk. Should I do some further manipulations on volume group to rebuild the mirror or it is suppossed to happen automatically. So, far nothing happened and vgdisplay still reports one of the physical volumes as unavailable although ioscan show it as CLAIMED. I am using hp-ux 10.20 with Mirroring.

thanks,
/M.
hi
16 REPLIES 16
Pete Randall
Outstanding Contributor

Re: Replace disk in mirror VG

Marius,

From this link,

http://www2.itrc.hp.com/service/iv/node.do?node=prod%2FWW_Start%2FN1%7C16

select Chapter 16 Logical Volume Manager (you then have to click on LVM).

In Chapter 16, you will find a section on Replacing a Failed Disk.

It's an excellent source for all the information concerning this topic.


Pete


Pete
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Replace disk in mirror VG

Nothing is going to happen by magic. If this is NOT a boot disk:

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

If it is a boot disk:
vgcfgrestore -n /dev/vg00 /dev/rdsk/c3t5d0
vgchange -a y /dev/vg00
mkboot /dev/rdsk/c3t5d0
mkboot -a "hpux -lq (;0)/stand/vmunix"
lvlnboot -R
vgsync

Of course, you need to substitute the appropriate devives and VG.




If it ain't broke, I can fix that.

Re: Replace disk in mirror VG

Thanks,

unfortunately, I do not have active support contract so cannot navigate knowledge trees. I will try commands then suggested. hope it will not crash my system. Worse comes to worse and disk is actually primary bootable. Disappointing althought that it cannot do it automatically.

/Marius
hi
A. Clay Stephenson
Acclaimed Contributor

Re: Replace disk in mirror VG

Replacing boot disks is no big deal -- as long as you are mirrored. I have enough drives that I routinely replace one or two per week including boot drives and never bother to shutdown.
If it ain't broke, I can fix that.

Re: Replace disk in mirror VG

another question: would it do the thing if I just reboot the system?
hi
A. Clay Stephenson
Acclaimed Contributor

Re: Replace disk in mirror VG

No, and in fact you would then have to boot off the alternate. Again, this ain't magic. You need to run the commands I listed for replacing a mirrored boot disk.
If it ain't broke, I can fix that.
A. Clay Stephenson
Acclaimed Contributor

Re: Replace disk in mirror VG

Ooops,

On the last vgsync, I left off the volume group
vgsync
should be
vgsync /dev/vg00

No point for this please, Clay
If it ain't broke, I can fix that.
Tim D Fulford
Honored Contributor

Re: Replace disk in mirror VG

Hi
The vgcfgrestore... commands 10/10. But it seems to me that there is a lack of understanding about the LVM. Quick LVM tour.

LVM is split into a few layers, Physical volumes (PV's) are the physical disks, Volume Groups (VGs) is a Logical space that comprises of 1 or more PVs, lastly Logical Volumes (LVs) is the logical partition of the volume group (which will map onto the PVs).

The PV will keep a map of the layout of the volume group information (Number of PV,s, the VG, LVs & there size) this is heal on the head & foot of each of the PVs variously refered to as VGRA (Volume group Raw Area) & VGDB (VG data base). This has TWO majour spin offs
o A disk KNOWs the layout of the LVs on it
o A disk can have this META information put back onto it if this information is lost or corrupted.

The first means that it is possible to simply import a volume group WITHOUT a volume group map file as long as you know rhe disks that comprised the volume group in the first place. the second means that using vgcfgrestore (a dump oon the filesystems /etc/lvmconf/...) the MATA information (VGDB & VGRA) can be restored to the disk.

Mirroring in LVM is done by mirroring each LV to each LV (NOT DISK to DISK). If one of the PVs where an LV resides dissapears, mirroring simply stops for that LV. This means that if you loose a mirrored disk it can be "overcome" by either
o PVcreating a new disk & simply re-mirroring to it
o using vgcfgrestore on a fixed disk
The vgcfgrestore method is far more elagant and that is what it is designed for, but the first is possible.

Anyway I hope this clears the background up slightly.

regards

Tim
-

Re: Replace disk in mirror VG

Last question before I start doing something. Replacement disk is not exactly the same disk as the one which died. I mean it is the same size (18GB) but the one that died is Seagate and replacement is IBM. I am sure they are not exactly same size or at least using differen geometry. Should in this case I rather have to simply
1) vgreduce to remove "old" PV
2) vgextend to create a "new" mirror with new disk
3) mkboot to make it bootable.

My worry is that if new disk is not exactly same vgcfgrestore might not work correctly as it most likele deals with low level hdd geometry (sectors, heads, cylinders, what have you) which will not be the same on differend vendor disk even if it is also 18gb size.

thanks,
/Marius
hi
Tim D Fulford
Honored Contributor

Re: Replace disk in mirror VG

Why are you installing a different disk?

I know that some manufactures disks are interchangable..BUT.. I rely on HP supplying the correct/compatable disk for my system.

Tim
-
Vasikaran Venkatesan
Frequent Advisor

Re: Replace disk in mirror VG

I do not think you have to do a vgreduce & extend. You already see that disk as CLAIMED, and all you have to do is vgcfgrestore, vgchange, mkboot & lvlnboot as Clay has spelt out. That should do the magic, i think.

Re: Replace disk in mirror VG

New disk is from HP but they use and supply different vendors disk that's for sure. Disk is actually pull from other L-class server. Funny thing they also mix disks in disk arrays.
hi
A. Clay Stephenson
Acclaimed Contributor

Re: Replace disk in mirror VG

In your initial posting, you mentioned 10.20 so this implies an older box. Be very careful that you are not substituting a High Voltage Differential (HVD/FWD) SCSI drive with LVD SCSI devices used on newer boxes. They are absolutely not compatible.

If the drives are compatible, you don't need to worry about disk geometry. The LVM data structures are at a much higher level. As lonf as the new drive equals or exceeds the capacity of the old drive, vgcfgrestore is all you need.
If it ain't broke, I can fix that.

Re: Replace disk in mirror VG

I am fully aware of LVD/HVD stuff that is fine. Why do I need vgchange -a y after vgcfgrestore? Does vgcfgrestore puts vg offline? I assume not since that's a boot vg. Also, man pages recommend to put vg offline before running vgcfgrestore - but I cannot since it is boot vg.

/M.
hi
A. Clay Stephenson
Acclaimed Contributor

Re: Replace disk in mirror VG

No, just pop in the new drive and run vgcfgrestore. You then do a vgchange -a y /dev/vg00 and that will bring the new disk "on-line".
If it ain't broke, I can fix that.

Re: Replace disk in mirror VG

everything worked just perfect. thanks Clay. I have only used lvlnboot -R /dev/vg00 since I had some inactive vgs that couldn't get rid off (mess in config) and so vgcfgbackup was complaining if I omit vg in lvlnboot -R. 10 points to Clay, thanks.

/M.
hi