cancel
Showing results for 
Search instead for 
Did you mean: 

mirroring on a single disk

 
SOLVED
Go to solution
Jayraj
Frequent Advisor

mirroring on a single disk

Hi,

I have a VG with single PV.But I find for each lE, there are 2 PE are allocated,is that mean mirroring has done on a single disk..?

and if mirroring is done on a single pv.. I want to move that mirror copy to the another disk.. by adding another disk, Please advice..
18 REPLIES
James R. Ferguson
Acclaimed Contributor
Solution

Re: mirroring on a single disk

HI:

If in fact someone mirrored a logical volume to the same physical disk, which you can verify from the output of 'lvdisplay -v' (where 'Mirror copies' > 0 too) then 'vgextend' a new physical disk into the volume group; 'lvreduce -m 0' the mirror copy; and 'lvextend -m 1' specifying the new target disk.

Be sure to verify that 'strict' allocation set (the default) for the logical volume before you mirror it. If not, repair this (with 'lvchange') before you re-mirror onto the newly added physical disk.

Regards!

...JRF...
Sunny123_1
Esteemed Contributor

Re: mirroring on a single disk

Hi

Check your lvdisplay output.In that you can find that mirror is on or not .And how you can say that you are doing mirror on the same disk???? Can you post your lvdisplay and /etc/lvmtab output?????

Regards
Sunny
Pete Randall
Outstanding Contributor

Re: mirroring on a single disk

You need to look at where the PE's are actually located, using lvdisplay -v, in order to tell for sure:

lvdisplay -v /dev/vg00/lvol1
--- Logical volumes ---
LV Name /dev/vg00/lvol1
.
.
.
Current LE 50
Allocated PE 100
.
.
.--- Logical extents ---
LE PV1 PE1 Status 1 PV2 PE2 Status 2
00000 /dev/dsk/c0t6d0 00000 current /dev/dsk/c0t5d0 00000 current


If they are on the same physical volume you will need to lvreduce the mirror, then reallocate the mirror properly using another physical volume.


Pete

Pete
johnsonpk
Honored Contributor

Re: mirroring on a single disk

Hi Swaraj,

Please post your lvdisplay -v

If you want move the mirror folow the below steps..
The following steps are for creating a mirroe copy on different disk(assuming you have mirror copy on the same disk)
first reduce the duplicate mirror copy from the smae disk
#lvreduce -m 0 /dev/vgxx/lvname
#change the lv allocation policy to strict
#lvchange -s y /dev/vgxx/lvname
Create a pv using pvcreate

Extend the vg using vgextend
create a mirror copy on the newly added disk
lvextend -m 1 /dev/vgxx/lvname


Regards
Johnson
Jayraj
Frequent Advisor

Re: mirroring on a single disk

Hi in lvdisplay mirror copies is 1, but here I found a an intresting thing in lvmtab output..

#strings /etc/lvmtab
/dev/vg00
XDv
/dev/dsk/c2t1d0
/dev/dsk/c3t0d0
/dev/vg02
XD|"
/dev/dsk/c4t0d0
/dev/dsk/c6t0d0
/dev/vg01
/dev/dsk/c4t1d0
/dev/dsk/c6t4d0

for vg02 we can see here tw pv's mentioned..But in vgdisplay -v vg02, it shows single pv with the below error..!

--- Physical volumes ---
PV Name /dev/dsk/c4t0d0
vgdisplay: Warning: couldn't query physical volume "/dev/dsk/c6t0d0":
The specified path does not correspond to physical volume attached to
this volume group
vgdisplay: Warning: couldn't query all of the physical volumes.
PV Status available
Total PE 17363
Free PE 6351
Autoswitch On

to my surprice, if I do pvdisplay of /dev/dsk/c6t0d0 I am getting the same error, But /dev/dsk/c6t0d0 is shown as unused in sam and pv display output..
# pvdisplay /dev/dsk/c6t0d0
pvdisplay: Warning: couldn't query physical volume "/dev/dsk/c6t0d0":
The specified path does not correspond to physical volume attached to
this volume group
pvdisplay: Warning: couldn't query all of the physical volumes.
pvdisplay: Couldn't retrieve the names of the physical volumes
belonging to volume group "/dev/vg02".
pvdisplay: Cannot display physical volume "/dev/dsk/c6t0d0".


Jayraj
Frequent Advisor

Re: mirroring on a single disk

Here is the lvdisplay output

--- Logical volumes ---
LV Name /dev/vg02/lvol4
VG Name /dev/vg02
LV Permission read/write
LV Status available/stale
Mirror copies 1
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 20000
Current LE 5000
Allocated PE 10000
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/c4t0d0 5000 5000

--- Logical extents ---
LE PV1 PE1 Status 1 PV2 PE2 Status 2
00000 /dev/dsk/c4t0d0 01280 current ??? 01280 stale
00001 /dev/dsk/c4t0d0 01281 current ??? 01281 stale
00002 /dev/dsk/c4t0d0 01282 current ??? 01282 stale
James R. Ferguson
Acclaimed Contributor

Re: mirroring on a single disk

Hi (again):

You have a dead disk. See:

http://docs.hp.com/en/5991-1236/When_Good_Disks_Go_Bad_WP.pdf

Regards!

...JRF...
Sunny123_1
Esteemed Contributor

Re: mirroring on a single disk

Hi again

It is showing that your one of the disk has failed.Plan to replace it.

Regards
Sunny
johnsonpk
Honored Contributor

Re: mirroring on a single disk

Hi Swaraj,

You second disk in the vg seems faulty,

try replacinf the disk


ZRegds
Johnson
Sunny123_1
Esteemed Contributor

Re: mirroring on a single disk

Viswanadhan
Regular Advisor

Re: mirroring on a single disk

Hi Swaraj,

First thing, mirror will not work on single disk.

Mirror requires minimum of 2 disks.

Regards,
Viswanadhan.
johnsonpk
Honored Contributor

Re: mirroring on a single disk


Viswanadhan

>>First thing, mirror will not work on single disk.

>>Mirror requires minimum of 2 disks.

Lv can be mirrored on single disk if you change the strict policy

to mirror lvol of vgs having only one disk(create mirror on single disk)
lvchange -s n
lvextend -m 1

I do agree that creating mirror on single disk doesnt make any sense..but it is possible in LVM

Regards
Johnson

Jayraj
Frequent Advisor

Re: mirroring on a single disk

Hi,

From the lvdisplay output, I have pasted above we can see that, the lv's are not mirrored in a same disk, but on the other dead disk, So is it safe to remove the dead disk with

vgreduce -f /dev/vg02

then adding newdisk, then mirror in to it..

please advice..
johnsonpk
Honored Contributor

Re: mirroring on a single disk

Hi Swaraj,

>>vgdisplay: Warning: couldn't query physical volume "/dev/dsk/c6t0d0":
The specified path does not correspond to physical volume attached to
this volume group
vgdisplay: Warning: couldn't query all of the physical volumes.


Since LVm detected the disk failure ,you can just repalce disk with a good one (assume the disk is hot swapable)
and perform the below steps

#vgcfgrestore -n
#vgchange -a y


Even you can go with your step but make sure that all of your lv mirror copy should be removed from the bad disk#

#lvreduce -m 0
#vgreduce or vgreduce -f
#replace the disk
#pvcreate
#vgextend
#lvextend -m 1

rgds
Johnson


Jayraj
Frequent Advisor

Re: mirroring on a single disk

Hi johnsonpk..

will vgcfgrestore make the dead disk alive, and usefull..!
johnsonpk
Honored Contributor

Re: mirroring on a single disk

Hi Swaraj,

You need to change the HDD with good one before doing vgcfgrestore

It is worth reading through the doc in the below link (read page 31 through 33 ) step 1,4,5,6 is for 11iv3

http://docs.hp.com/en/5991-1236/When_Good_Disks_Go_Bad_WP.pdf

Rgds..
JOhnson

Patrick Wallek
Honored Contributor

Re: mirroring on a single disk

>>will vgcfgrestore make the dead disk alive

Doubtful.

If the disk is well and truly dead, nothing you do will bring it back to life.

Jayraj
Frequent Advisor

Re: mirroring on a single disk

Hi all Thank you for your time,


This is an excellent forum.. Thank you very much...!