Operating System - HP-UX
1838359 Members
3023 Online
110125 Solutions
New Discussion

Re: Break Mirror and Mirror it back

 
SOLVED
Go to solution
Prakarn
Occasional Contributor

Break Mirror and Mirror it back

I want to break mirror disks of Vg01&Vg02 and mirror it back after replace the disks, please advise.
My HP-UX version is 11.11

$ bdf
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol3 516096 361048 153896 70% /
/dev/vg00/lvol1 298928 112464 156568 42% /stand
/dev/vg00/lvol8 4710400 1244544 3439328 27% /var
/dev/vg00/lvol7 1982464 1446496 531808 73% /usr
/dev/vg00/lvol4 1024000 563992 456464 55% /tmp
/dev/vg00/lvol6 3072000 1808088 1254104 59% /opt
/dev/vg00/lvol5 516096 42584 469832 8% /home
/dev/vg00/lvol9 1024000 1357 958735 0% /extra
/dev/vg02/lvol2 1024000 405241 580106 41% /epics_source
/dev/vg01/lvol2 10240000 92901 9512929 1% /data2
/dev/vg01/lvol4 1024000 318847 661145 33% /data2/epics_sysl
/dev/vg01/lvol1 10240000 5827184 4279020 58% /data1
/dev/vg01/lvol3 5120000 1845625 3069793 38% /II_SYSTEM
/dev/vg02/lvol1 1536000 178940 1272307 12% /II_DATABASE

epics131.SU# lvdisplay -v /dev/vg01/lvol2 |more
--- Logical volumes ---
LV Name /dev/vg01/lvol2
VG Name /dev/vg01
LV Permission read/write
LV Status available/syncd
Mirror copies 1
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 10000
Current LE 2500
Allocated PE 5000
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/c22t0d2 2500 2500
/dev/dsk/c11t0d0 2500 2500

--- Logical extents ---


epics131.SU# lvdisplay -v /dev/vg02/lvol2 |more
--- Logical volumes ---
LV Name /dev/vg02/lvol2
VG Name /dev/vg02
LV Permission read/write
LV Status available/syncd
Mirror copies 1
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 1000
Current LE 250
Allocated PE 500
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/c22t0d3 250 250
/dev/dsk/c11t0d1 250 250

--- Logical extents ---
Standard input
6 REPLIES 6
Steven E. Protter
Exalted Contributor

Re: Break Mirror and Mirror it back

lvsplit /dev/vg02/lvol2

...

repeat for every mirrored logical volume.

....

Do your work,

lvextend -m 1 /dev/vg02/lvol2 /dev/dsk/c22t0d3

....

repeat for other logical volumes.

....

If you are doing some rearrangement, you may need to change the disk device at the end of that command.

SAM can do this for you, but command line is better, especially for the mirroring with lvextend.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Ermin Borovac
Honored Contributor
Solution

Re: Break Mirror and Mirror it back

Remove mirror from /dev/dsk/cxtxdx

# lvreduce -m 0 /dev/vgxx/lvolxx /dev/dsk/cxtxdx

Reinstate mirror to /dev/dsk/cxtxdx

# lvextend -m 1 /dev/vgxx/lvolxx /dev/dsk/cxtxdx

Prakarn
Occasional Contributor

Re: Break Mirror and Mirror it back


How do I check which disk is a primary disk for mirror?
Naveej.K.A
Honored Contributor

Re: Break Mirror and Mirror it back

Hi,

Use the lvreduce / lvextend !!!

There is no concept of primary/secondary disks in a mirror. Only your root VG will have the primary / secondary boot path and that is with respect to booting.

the command, setboot will give you the primary and alternate boot disks.

As far as VG01 is concerned there is no primary/secondary disks.

--- Distribution of logical volume ---
PV Name LE on PV PE on PV
/dev/dsk/c22t0d3 250 250
/dev/dsk/c11t0d1 250 250

Perhaps you can call c22tod3 as primary and c11t0d1 as secondary.

Regards,
Naveej
practice makes a man perfect!!!
Sudeesh
Respected Contributor

Re: Break Mirror and Mirror it back

Hi,
Like Naveej said there is no primary/secondary disk concept here. The best way to accomplish your task will be using lvreduce/lvextend.

assume following disks are in vg01 and you want to replace disk c1t2d0.

vg01
/dev/dsk/c1t1d0
/dev/dsk/c1t2d0

vg01 having following lvols
/dev/vg01/lvol2 10240000 92901 9512929 1% /data2
/dev/vg01/lvol4 1024000 318847 661145 33% /data2/epics_sysl
/dev/vg01/lvol1 10240000 5827184 4279020 58% /data1
/dev/vg01/lvol3 5120000 1845625 3069793 38% /II_SYSTEM


lvreduce -m 0 /dev/vg01/lvol2 /dev/dsk/c1t2d0
#reducing mirror frm disk. Repeat same for other lvols

pvdisplay -v /dev/dsk/c1t2d0
#to ensure no other lvol exists on c1t2d0

vgreduce /dev/vg01 /dev/dsk/c1t2d0
#removing the disk from vg. You can physically remove the old disk at this point

#insert the new disk and configure it to vg01

lvextend -m 1 /dev/vg01/lvol2 /dev/dsk/new_disk
#repeat same for all lvols



Sudeesh





The most predictable thing in life is its unpredictability
Prakarn
Occasional Contributor

Re: Break Mirror and Mirror it back

Thank you very much for all of you.