Operating System - HP-UX
1753931 Members
9582 Online
108810 Solutions
New Discussion юеВ

Re: How to know if a disk is in mirror??

 
SOLVED
Go to solution
hboo
Frequent Advisor

How to know if a disk is in mirror??

Hi all
I have a bad disk and I need to know if this disk is in mirror.. How i can do this?

Thanks
8 REPLIES 8
KapilRaj
Honored Contributor

Re: How to know if a disk is in mirror??

lvdisplay .. Check for any stale extents

Regards,

Kaps
Nothing is impossible
Pupil_1
Trusted Contributor

Re: How to know if a disk is in mirror??

lvdisplay -v /dev//

this will show you the mirrored LVs.

You will be seeing in the Logical extents
LE PV1 PE1 Status 1 PV2 PE2 Status 2
in case of mirror.

In case of a non-mirror, you will see only
LE PV1 PE1 Status 1
There is always something new to learn everyday !!
Geoff Wild
Honored Contributor

Re: How to know if a disk is in mirror??

For LVM

# cat chkstaledsks
#!/bin/sh
# Identifies and displays stale extends on all system volume groups.
# Useful to determine defect harddisks in mirrored enviroments
# Geoff Wild

vgdisplay -v | awk '/LV Name/ { print $3 }' | xargs lvdisplay -v | grep -i -e "lv name" -e "lv status" -e stale -e '?'


For VXVM - need to see how many plexes are in the Volume - if only one, then not mirrored.

Rgds...Geoff

Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Pupil_1
Trusted Contributor

Re: How to know if a disk is in mirror??

check the /etc/lvmtab (strings /etc/lvmtab) and check to which vg the faulty disk belongs to.

vgdisplay -v will give the lvname in the vg.
There is always something new to learn everyday !!
DCE
Honored Contributor
Solution

Re: How to know if a disk is in mirror??


Mirroring occurs at the logical volume level. in order to figure out if the disk is mirrored, you will first have to figure out which Volume group the disk is in.
vgdisplay -v will give you that info
(or strings /etc/lvmtab)

Once you have the vg info, you will have to do a lvdisplay -v against all of the logical volumes in that VG to see which ones, if any, are using that disk.
V.Manoharan
Valued Contributor

Re: How to know if a disk is in mirror??

Hi ,
If the logical volume is mirrored the out put will show as below. In the Logical volume properties the value of Mirror copies will 1 or more.

# lvdisplay -v /dev/vg00/root|pg
--- Logical volumes ---
LV Name /dev/vg00/root
VG Name /dev/vg00
LV Permission read/write
LV Status available/syncd
Mirror copies 1 ===> Number of mirror copies will be there
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 3904
Current LE 976
Allocated PE 1952
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/c4t12d0 976 976
/dev/dsk/c4t10d0 976 976

--- Logical extents ---
LE PV1 PE1 Status 1 PV2 PE2 Status 2
00000 /dev/dsk/c4t12d0 03364 current /dev/dsk/c4t10d0 03364 current
00001 /dev/dsk/c4t12d0 03365 current /dev/dsk/c4t10d0 03365 current
00002 /dev/dsk/c4t12d0 03366 current /dev/dsk/c4t10d0 03366 current
00003 /dev/dsk/c4t12d0 03367 current /dev/dsk/c4t10d0 03367 current
00004 /dev/dsk/c4t12d0 03368 current /dev/dsk/c4t10d0 03368 current

For isolation if it having a faulty disk check vgdisplay and lvdisplay for stale entries.

Thanks and regards
Manoharan
hboo
Frequent Advisor

Re: How to know if a disk is in mirror??

Thanks all of you ...
The output say's there is one mirror copy


--- Logical volumes ---
LV Name /dev/vg02/lvol10
VG Name /dev/vg02
LV Permission read/write
LV Status available/syncd
Mirror copies 1
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 17360
Current LE 4340
Allocated PE 8680
Stripes 0
Stripe Size (Kbytes) 0
Bad block on
Allocation strict
IO Timeout (Seconds) default

hboo
Frequent Advisor

Re: How to know if a disk is in mirror??

Thanks all of you ...

See you
; )