Remove Faulty disk from HP-UX LVM VG

Requirement to remove a faulty mirrored disk from hp-ux LVM

<root@pdwp1s>/etc # vgdisplay -v /dev/vg00
vgdisplay: Warning: couldn't query physical volume "/dev/dsk/c2t0d0":
The specified path does not correspond to physical volume attached to
this volume group
vgdisplay: Warning: couldn't query all of the physical volumes.
--- Volume groups ---
VG Name                     /dev/vg00
VG Write Access             read/write
VG Status                   available
Max LV                      255
Cur LV                      10
Open LV                     10
Max PV                      16
Cur PV                      3
Act PV                      2
Max PE per PV               4350
VGDA                        4
PE Size (Mbytes)            8
Total PE                    8680
Alloc PE                    7713
Free PE                     967
Total PVG                   0
Total Spare PVs             0
Total Spare PVs in use      0

vgdisplay: Warning: couldn't query physical volume "/dev/dsk/c2t0d0":
The specified path does not correspond to physical volume attached to
this volume group
vgdisplay: Warning: couldn't query all of the physical volumes.
   --- Logical volumes ---
   LV Name                     /dev/vg00/lvol1
   LV Status                   available/stale
   LV Size (Mbytes)            504
   Current LE                  63
   Allocated PE                126
   Used PV                     1

vgdisplay: Warning: couldn't query physical volume "/dev/dsk/c2t0d0":
The specified path does not correspond to physical volume attached to
this volume group
vgdisplay: Warning: couldn't query all of the physical volumes.
   LV Name                     /dev/vg00/lvol2
   LV Status                   available/stale
   LV Size (Mbytes)            4096
   Current LE                  512
   Allocated PE                1536
   Used PV                     2

vgdisplay: Warning: couldn't query physical volume "/dev/dsk/c2t0d0":
The specified path does not correspond to physical volume attached to
this volume group

Suggest a safest wasy to achieve this ...

Is this the same computer as the original computer in this post:
http://www.unix.com/hp-ux/176351-hp-ux-server-cloning.html

What output do you get from this "ioscan" enquiry:

ioscan -fnCdisk

Assuming this is one mirror of the system disc and you have physically removed the disc or corrupted it, this is a delicate sitution. The tactics depend on whether you want to replace the disc or permanently remove the disc. Because you are tempting fate with your cloning guesswork it has to be assumed that this is not a straightforward disc failure.

If you don't already have a copy of "When good disks go bad", then it is currently on this link. Well worth a read to help you consider your options:
http://bizsupport2.austin.hp.com/bc/docs/support/SupportManual/c01911837/c01911837.pdf

Based on your previous posts we assume that you have no backup of this system.

No this is another set of server on which am testing the clone behaviors ..

Here what have did
# OS data alread in 1 mirrored state
# HAVE mirrored it to one more disk
# AND removed the third disk
# Then have run below script

# sh -x  lvmirr_b.sh
## cat lvmirr_b.sh
for i in 1 2 3 4 5 6 7 8 9
do
 # lvextend -m 1 /dev/vg00/lvol${i} /dev/dsk/c2t0d0    ## As have extended to  -m 2
 lvreduce -m 1 -A n -k  /dev/vg00/lvol${i} /dev/dsk/c2t0d0
done

# vgreduce -f  /dev/dsk/c2t0d0
# mv /etc/lvmtab /etc/lvmtab_9212
# vgscan -v 

### And now am getting above error 

### Below out for more desc..
 # lvdisplay -v /dev/vg00/lvol1
lvdisplay: Warning: couldn't query physical volume "/dev/dsk/c2t0d0":
The specified path does not correspond to physical volume attached to
this volume group
lvdisplay: Warning: couldn't query all of the physical volumes.
--- Logical volumes ---
LV Name                     /dev/vg00/lvol1
VG Name                     /dev/vg00
LV Permission               read/write
LV Status                   available/stale
Mirror copies               1
Consistency Recovery        MWC
Schedule                    parallel
LV Size (Mbytes)            504
Current LE                  63
Allocated PE                126
Stripes                     0
Stripe Size (Kbytes)        0
Bad block                   off
Allocation                  strict/contiguous
IO Timeout (Seconds)        default

   --- Distribution of logical volume ---
   PV Name            LE on PV  PE on PV
   /dev/dsk/c2t2d0    63        63

   --- Logical extents ---
   LE    PV1                PE1   Status 1 PV2                PE2   Status 2
   00000 /dev/dsk/c2t2d0    00000 current  ???                00000 stale
   00001 /dev/dsk/c2t2d0    00001 current  ???                00001 stale
   00002 /dev/dsk/c2t2d0    00002 current  ???                00002 stale
.
.

--Shirish

Please post the ioscan requested in post #2. I suspect that you have pulled the wrong disc.

# ioscan -funC disk
Class     I  H/W Path        Driver   S/W State   H/W Type     Description
===========================================================================
disk     41  0/0/1/1.0.0     sdisk    CLAIMED     DEVICE       HP 36.4GST336753LC
                            /dev/dsk/c1t0d0   /dev/rdsk/c1t0d0
disk      0  0/0/1/1.2.0     sdisk    CLAIMED     DEVICE       HP 36.4GST336753LC
                            /dev/dsk/c1t2d0   /dev/rdsk/c1t2d0
disk      1  0/0/2/0.2.0     sdisk    CLAIMED     DEVICE       HP 36.4GST336753LC
                            /dev/dsk/c2t2d0   /dev/rdsk/c2t2d0
disk      2  0/0/2/1.2.0     sdisk    CLAIMED     DEVICE       HP      DVD-ROM 305
                            /dev/dsk/c3t2d0   /dev/rdsk/c3t2d0
disk      3  0/10/0/0.1.0.0.0.0.0  sdisk    CLAIMED     DEVICE       HP      A6189B
                            /dev/dsk/c4t0d0   /dev/rdsk/c4t0d0

According to lvdisplay there is no sign of a second mirror, but it is behaving as if the single mirror to c2t0d0 has failed

lvreduce -m 1 -A n -k  /dev/vg00/lvol${i} /dev/dsk/c2t0d0

Why "-A n" ?
Why "-k" ?

I'm wondering whether you did not have any mirrors on this system and actually issued what is commented out in your script:

lvextend -m 1 /dev/vg00/lvol${i} /dev/dsk/c2t0d0

When I started mirroring the VG00 on my new disk, the system had already 2 disk in mirrored state ... At that time my mirror value was 1, so while mirroring 3rd disk have used -m 2 .. and my # lvlnboot -v shows all boot order without error .

Then have removed my 3rd disk directly.. without spilting or reducing vg ..

After that had ran above cmnds .. and get stuck .. As I understand now current state is my all mirrored got failed .. only 1 active boot disk is there ... it may be bcz have done wrong vg reduce or lvreduce .. :frowning:

## Now what I want is to .. remove what error am getting then remirror this OS on second disk .. to safely handover this server ...

##########

lvreduce -m 1 -A n -k  /dev/vg00/lvol${i} /dev/dsk/c2t0d0
 
-A n ::  
Do not backup configuration changes after lvreduce .. 
-k:: IS to be used when your pv is missing (i.e disk is not there u had removed )

Had taken these args from source
http://h20000.www2.hp.com/bc/docs/support/SupportManual/c02261098/c02261098.pdf

I may repeat myself but if you followed my previous post, where I mentioned how to do the dd, you should have understood why HP did not caution the way you wanted to do the dd.
I have a proper clone of a disk that knows only one disk in vg00, thus no errors
You have a copy of a single disk from a vg00 which is mirrored... (so all will be stale...)
...

Now you havent said since your posts are unclear to me (which boxes are doing what..)
On what box are you working with now. How was it mounted, did you test if you could reboot from the second disk?
On what disk have you booted now?
Is this disk the Primary?
etc...

Subsidiary question: You have nowhere a golden image? even for your production machine?
Are you completely relying on a mirrored rootvg?

Sorry for confusion..!!

This is a test environment on which am testing the clone behavior .. initially on this server 2 hdd with 1 vg00.. which was in mirrored state . have tested server was able to boot on either of single disk ..

Then.. have inserted a new disk and build a new mirrored disk ..bootable ... then without any proper reduce .. have removed that disk and rebooted the server and now am trying to remove the error that am getting with vgdisplay ..

I believe have done some wrong step to reduce the VG and LV mirror path for new disk (that had removed ) and now mirroring is totally broken ... only primary disk is active now now ..

From here I want to ... remove all error from VG and rebuilt the mirroring i.e. as rollback the server it it's initial state ..

Guide me how I can remove all above error (1st Thread) from this server

Hi Shiri,

Request you to provide answers and o/p of some commands:-

  1. Is this lvreduce done with any specific reason? the question is have you seen that disk has gone bad physically . or were there any amber on the disk?
  2. the o/p of sautil /dev/ciss0 is needed. which can show that Disk is, if you cannot see the disks physically.
    ioscan -m dsf
    3.strings /etc/lvmtab
  3. need to c the full o/p of vgdisplay -v.