Operating System - HP-UX
1848584 Members
1776 Online
104033 Solutions
New Discussion

Re: Replacing a Broken Mirror Disk

 
SOLVED
Go to solution
ian mcgrath
New Member

Replacing a Broken Mirror Disk

Hi,

I have a disk configuration problem. I found that one of the mirror disks in my vg00 group had failed, and the mirror had become stale.

I removed the disk and replace with a spare. However, I am unable to use the vgcfgretsore command with success. The process I am using is as follows:

root : /# pvcreate -f /dev/rdsk/c1t2d0
Physical volume "/dev/rdsk/c1t2d0" has been successfully created.

root : /# vgcfgrestore -n /dev/vg00 /dev/dsk/c1t2d0
vgcfgrestore: Couldn't query physical volume "/dev/dsk/c1t2d0":
The specified path does not correspond to physical volume attached to
this volume group
Configuration info for Physical Volume "/dev/dsk/c1t2d0" not found
in "/etc/lvmconf/vg00.conf" :
Character-special file for PV not supplied on command line, OR
PV did not belong to Volume Group /dev/vg00 when configuration file was created.

Has anyone got any ideas?

Thanks,
Ian.
12 REPLIES 12
Jeff Schussele
Honored Contributor

Re: Replacing a Broken Mirror Disk

Hi Ian,

Couple of things.
First if this is vg00 you'll need to
pvcreate -f -B /dev/rdsk/c1t2d0 as the -B reserves the boot space.
As to the vgcfgrestore, my guess would be that the .conf file was not accurate or up to date OR you have to use /dev/rdsk/c1t2d0 - the raw device.
If inaccurate .conf, that's not a problem though, just create the PV/VG/LVs & remirror them.
Don't forget the lvlnboot commands to set the disk for root, boot,primary swap & dump.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
PIYUSH D. PATEL
Honored Contributor

Re: Replacing a Broken Mirror Disk

Hi,

Just a thought :
1. you chould have run the vgcfgbackup command after the mirror harddisk was created earlier or after any changes were made to the root vg.

2. the old mirror disk which failed had the same device file name /dev/dsk/c1t2d0 ??

If not then try to set the SCSI ID of the harddisk as that of the old harddisk and you will be able to run the vgcfgrestore command.

Check the contents of the /etc/lvmtab by

strings /etc/lvmtab and see the device files in the /dev/vg00 and set the new harddisk with the same ID.

What is the output of lvlnboot -v

Or else you will have to create a new mirror.

Try using the pvcreate -B for making the disk as a boot disk.

Piyush
PIYUSH D. PATEL
Honored Contributor
Solution

Re: Replacing a Broken Mirror Disk

Hi,

To Create a new mirror disk,

1) pvcreate -B /dev/rdsk/c1t2d0
2)vgextend /dev/vg00 /dev/dsk/c1t2d0
3)mkboot /dev/rdsk/c1t2d0
4)mkboot -a "hpux -lq(;0)/stand/vmunix" /dev/rdsk/c1t2d0
5)lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c1t2d0
6)lvextend -m 1 /dev/vg00/lvol2 /dev/dsk/c1t2d0
7) lvextend -m 1 /dev/vg00/lvol3 /dev/dsk/c1t2d0
8)lvlnboot -b /dev/vg00/lvol1
9)lvlnboot -s /dev/vg00/lvol2
10)lvlnboot -r /dev/vg00/lvol3
11)lvlnboot -d /dev/vg00/lvol2

12)lvlnboot -R /dev/vg00
13)lvlnboot -v
Will show you both the disk. Reboot the system.

Piyush
Stefan Saliba
Trusted Contributor

Re: Replacing a Broken Mirror Disk

First of all check if c1t2d0 is claimed. do an ioscan and see if the hardware is claimed.


ioscan -fnC disk

then vgcfgrestore -n /dev/vg00 /dev/rdsk/c1t2d0
vgchange -a y /dev/vg00
mkboot /dev/rdsk/c1t2d0
mkboot -a "hpux" /dev/rdsk/c1t2d0
lvlnboot -R
vgsync vg00

This is the procedure I use.

check using "strings /etc/lvmtab" to see if c1t2d0 is actually a member of vg00.

Be sure you are using the right device file and the charcater not blcok device

Good luck
Stefan




Stefan Saliba
Trusted Contributor

Re: Replacing a Broken Mirror Disk

What Piyush is suggesting is only used when to create a mirror from scratch. In your case the mirror already existed and a disk failed. So with a good vgcfgbackup you do not need to re-mirror again.

To do what Piyush is saying you need to reduce the mirrors to 0 before removing the disks. It works but is very long.

Use vgsync to re-sync stale lvols.

One last thing, I see no reason why to reboot. I've done it many times, never rebooted, what is the use to replace a mirror disks hot plug and STILL reboot..

I do not agree


Good luck
Stefan
ian mcgrath
New Member

Re: Replacing a Broken Mirror Disk

Thanks for quick responses. I have run the following commands:

root : /# ioscan -fnC disk
Class I H/W Path Driver S/W State H/W Type Description
=====================================================================
disk 0 0/0/1/1.0.0 sdisk CLAIMED DEVICE IBM DMVS18D
/dev/dsk/c1t0d0 /dev/rdsk/c1t0d0
disk 1 0/0/1/1.2.0 sdisk CLAIMED DEVICE HP 18.2GMAN3184MC
/dev/dsk/c1t2d0 /dev/rdsk/c1t2d0....

root : /# pvcreate -f -B /dev/rdsk/c1t2d0
Physical volume "/dev/rdsk/c1t2d0" has been successfully created.

root : /# vgcfgrestore -n /dev/vg00 /dev/rdsk/c1t2d0
vgcfgrestore: Couldn't query physical volume "/dev/dsk/c1t2d0":
The specified path does not correspond to physical volume attached to
this volume group
Volume Group configuration has been restored to /dev/rdsk/c1t2d0

However, even at this point a vgdisplay on the group does not show the new PV. I am thinking that it will be necessary to re-create the whole mirror configuration as per Piyush's suggestion.

issuing a strings on the /etc/lvmtab displays the following:

/dev/vg00
/dev/dsk/c2t2d0

So the new disk is not part of the VG.

I am a little nervous about issuing the vgchange -a y /dev/vg00 command as the system is online and very critcal. However, would it work with the new disk not showing in the VG?

Trending carefully,
Ian.
Jeff Schussele
Honored Contributor

Re: Replacing a Broken Mirror Disk

Hi (again) Ian,

What does /etc/lvmtab show for the vg00 VG?
If not c1t2d0 but another that's now gone.
Then vgreduce the nonexistent one & vgextend vg00 to include c1t2d0.
Then you can vgcfgrestore I believe.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
PIYUSH D. PATEL
Honored Contributor

Re: Replacing a Broken Mirror Disk

Hi,

don't worry, go in for creating the new mirror disk for vg00.

If you have Ignite loaded on your system then take the Ignite tape backup using make_tape_recovery.

Piyush
ian mcgrath
New Member

Re: Replacing a Broken Mirror Disk

The strings command for /etc/lvmtab is as follows:

root : /# strings /etc/lvmtab
/dev/vg01
/dev/dsk/c1t0d0
/dev/dsk/c2t0d0
/dev/vg00
/dev/dsk/c2t2d0
/dev/vg02
/dev/dsk/....

Only the active disk is in VG00. I do have the original /etc/lvmtab, with both disks. When this is in place I am unable to use the pvcreate command.

If I go about re-creating the mirror from scratch, do I need to remove anything first (e.g. vgreduce or lvremove)?

Also, as this is VG00 can I do this work in multi-user with the file systems mounted?

Thanks,
Ian.
Sandip Ghosh
Honored Contributor

Re: Replacing a Broken Mirror Disk

It is always better to do it from scratch. You need not to remove anything. Do accordingly, as described by piyush. The only problem is that, the Server will be running slow when you do all these creation. And piyush had given only for 3 lvols, its better to do the mirror for all the lvols.

Sandip
Good Luck!!!
PIYUSH D. PATEL
Honored Contributor

Re: Replacing a Broken Mirror Disk

Hi,

Since the new disk is not in your lvmtab, you need not worry. Also execute the lvlnboot -v and check whether it shows only one disk.

Also check vgdisplay -v /dev/vg00 and check whether there is only one harddisk in this vg.

I recommend to do it after going to the single user mode.

After all the steps for mirroring are over and you see both the disks by command lvlnboot -v
Give the command
#lvsync /dev/vg00 ( to sysncronize the mirror )

and then # shutdown -r

All the best,
Piyush
ian mcgrath
New Member

Re: Replacing a Broken Mirror Disk

Thankyou everyone for your help - espiecially Piyush. I will carrying out the work at the week when the system can be offline. Fingers crossed.

Cheers,
Ian