Operating System - HP-UX
1832907 Members
3334 Online
110048 Solutions
New Discussion

Removing faulty disk from mirror

 
rodh_z
Advisor

Removing faulty disk from mirror

Hi all,

I have an HP-UX 10.23 with mirrored disks.

A disk failed (I have no more maintenance for this host...).
I want to remove the mirror from the
logical volumes and remove the faulty disk from the Volume Group.
# strings /etc/lvmtab
/dev/vg00
cd7^
/dev/dsk/c0t6d0
/dev/dsk/c0t4d0
/dev/dsk/c0t5d0
/dev/dsk/c0t3d0
/dev/vgapp
cd7d
/dev/dsk/c3t0d1
/dev/dsk/c3t1d1
/dev/vghmi
!$7b
/dev/dsk/c3t0d2
/dev/dsk/c3t1d2
/dev/vgdb
U7]O'
/dev/dsk/c3t0d0
/dev/dsk/c3t1d0
/dev/vgoradb
U7]Oe
/dev/dsk/c3t0d3
/dev/dsk/c3t1d3

==> c0t5d0 is faulty

# lvdisplay -v /dev/vg00/lvol8
lvdisplay: Warning: couldn't query physical volume "/dev/dsk/c0t5d0":
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/lvol8
VG Name /dev/vg00
LV Permission read/write
LV Status available/stale
Mirror copies 1
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 512
Current LE 128
Allocated PE 256
Stripes 0
Stripe Size (Kbytes) 0
Bad block on
Allocation strict
IO Timeout (Seconds) default

--- Distribution of logical volume ---
PV Name LE on PV PE on PV
/dev/dsk/c0t3d0 128 128

--- Logical extents ---
LE PV1 PE1 Status 1 PV2 PE2 Status 2
0000 ??? 0462 stale /dev/dsk/c0t3d0 0462 current
0001 ??? 0463 stale /dev/dsk/c0t3d0 0463 current
0002 ??? 0464 stale /dev/dsk/c0t3d0 0464 current
0003 ??? 0465 stale /dev/dsk/c0t3d0 0465 current
0004 ??? 0466 stale /dev/dsk/c0t3d0 0466 current
0005 ??? 0467 stale /dev/dsk/c0t3d0 0467 current
0006 ??? 0468 stale /dev/dsk/c0t3d0 0468 current

...

When I try:

# lvreduce -m 0 /dev/vg00/lvol8 /dev/dsk/c0t5d0
lvreduce: Warning: couldn't query physical volume "/dev/dsk/c0t5d0":
The specified path does not correspond to physical volume attached to
this volume group
lvreduce: Warning: couldn't query all of the physical volumes.
lvreduce: Physical volume "/dev/dsk/c0t5d0" does not belong
to volume group "/dev/vg00".
Logical volume "/dev/vg00/lvol8" is not reduced.

# vgreduce /dev/vg00 /dev/dsk/c0t5d0
vgreduce: Couldn't query physical volume "/dev/dsk/c0t5d0":
The specified path does not correspond to physical volume attached to
this volume group

How can I remove the disk?

Thanks in advance for your help,

Kind Regards,

Rod
7 REPLIES 7
Jeeshan
Honored Contributor

Re: Removing faulty disk from mirror

Hey, really interesting. There is a similar thread like you.

http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=183447
a warrior never quits
Jeeshan
Honored Contributor

Re: Removing faulty disk from mirror

Hi

Everything you need is in the attached pdf file.
a warrior never quits
Sajjad Sahir
Honored Contributor

Re: Removing faulty disk from mirror

lvreduce -m 0 -A n /dev/vg00/logical volume name pvname
ok
this u can remove mirror first where 0 indicates u have only one mirror copy
if it is two u can use number 1
once u confirmed the disk has no physcial or logical extends u can remove it from volume group by using vgreduce command
vgreduce vgname then physcial volume name
ex: vgreduce vg00 /dev/dsk/c0t0d5
rodh_z
Advisor

Re: Removing faulty disk from mirror

Got this error:
We know that we can't able to break the mirror when I have "stale". Or is there any way to break mirror when there's "stale ???

# lvreduce -m 0 -A n -k /dev/vg00/lvol8 /dev/dsk/c0t5d0
Physical extents on remaining physical volumes are stale or
Remaining physical volumes are not responding.
lvreduce: The LVM device driver failed to reduce mirrors on
Logical volume "/dev/vg00/lvol8" is not reduced

# lvdisplay -v /dev/vg00/lvol8 |grep -i stale |wc -l
776
Sajjad Sahir
Honored Contributor

Re: Removing faulty disk from mirror

dear
u can remove the mirror copy with the above command. if pvdisplay command is failed while booting then only lvreduce fail but from there also u can use key value for removing mirror
ok
lvdisplay -v -k /dev/vg00/logical volume name
it iwll display u key value

use this command then
lvreduce -m 0 -A n -k /dev/vg00/logicalvolume key

if the disk u can read then u can extend u extents to anohter physcial volume in volume group
by using pvmove command
pvmove physicalvolum1 physcial volume2

### this means u setup u disk free now u can easily remove u physical volume from u volume group

by using vgreduce command what i posted before. if the disk is not available then u have to force to reduce it but in this case u should rebuild the lvmtab file

vgreduce -f vg00
mv /etc/lvmtab /etc/lvmtab.back
vgscan -v
ok this is the complete for u posted quetion








Mridul Shrivastava
Honored Contributor

Re: Removing faulty disk from mirror

Hi,

First check the lvdisplay -v /dev/vg00/lvol8, that looks like follows:

LE PV1 PE1 Status 1 PV2 PE2 Status 2
0000 ??? 0462 stale /dev/dsk/c0t3d0 0462 current
0001 ??? 0463 stale /dev/dsk/c0t3d0 0463 current

then check the o/p with -k option, this will show you the key value for both the disk. Note down the key value for the first disk where it is showing ??? now.

Then you need to execute the lvreduce command using -k of the faulty disk.

Make sure that you execute this command on all the LVs since ur other LVs would have been mirrored across this disk as well.
Time has a wonderful way of weeding out the trivial
rodh_z
Advisor

Re: Removing faulty disk from mirror

Thanks for all the comments!

Cheers,
Rodz