Operating System - HP-UX
1833814 Members
2013 Online
110063 Solutions
New Discussion

pvchange OR lvreduce - what should I use to Break Mirrors

 
TMcB
Super Advisor

pvchange OR lvreduce - what should I use to Break Mirrors

Hi everyone

One side of our SAN disks will be down for about 1 hour while firmware upgrades etc are being carried out. The SAN team have asked us to stop I/O to these disks.

I was going to use :
lvreduce – m 0 /dev/vgsgm/lvacc /dev/dsk/c34t0d0
and bring the disks back in using :
lvextend -m 1 /dev/vgsgm/lvacc /dev/dsk/c34t0d0

But after reading through the forumn - would I be better to use :

Break mirror :
pvchange -a n
Re sync :
pvchange -a y

We have a test server, and I used the pvchange command to break a mirror -
how can I tell this has worked. When I ran lvdisplay - it didnt look any different?

Thanks for you advice
T
8 REPLIES 8
Robert-Jan Goossens
Honored Contributor

Re: pvchange OR lvreduce - what should I use to Break Mirrors

T,

If you have LVM OLR functionality available, I would use it. It simply detach the device.

# pvchange -a n /dev/dsk/c34t0d0

After your san team has finished, reattach them and run

# pvchange -a y /dev/dsk/c34t0d0

http://docs.hp.com/en/5991-1236/When_Good_Disks_Go_Bad.pdf
Page 17/18

Regards,
Robert-Jan

Ps. You are not talking about creating a full backup of your before your SAN Team starts, but I have a feeling you have got that covered.
TMcB
Super Advisor

Re: pvchange OR lvreduce - what should I use to Break Mirrors

Hi
yep - backups will be done.
Once I run the 'pvchange -n' command, how can I see my LVs using only one disk?

Thanks
T
TMcB
Super Advisor

Re: pvchange OR lvreduce - what should I use to Break Mirrors

Hi
yep - backups will be done, and OLR is available.
Once I run the 'pvchange -n' command, how can I see my LVs using only one disk?
Thanks
T
Robert-Jan Goossens
Honored Contributor

Re: pvchange OR lvreduce - what should I use to Break Mirrors

lvdisplay -v /dev/vgxx/lvoly

Regards,
Robert-Jan
TMcB
Super Advisor

Re: pvchange OR lvreduce - what should I use to Break Mirrors

but I cant see any difference using lvdisplay :

root [/]> lvdisplay -v /dev/vgsgm/lvacc
--- Logical volumes ---
LV Name /dev/vgsgm/lvacc
VG Name /dev/vgsgm
LV Permission read/write
LV Status available/syncd
Mirror copies 1
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 500
Current LE 125
Allocated PE 250
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/c12t0d0 125 125
/dev/dsk/c13t0d0 125 125

--- Logical extents ---
LE PV1 PE1 Status 1 PV2 PE2 Status 2
00000 /dev/dsk/c12t0d0 04090 current /dev/dsk/c13t0d0 02554 current


root[/]> pvchange -a n /dev/dsk/c13t0d0
Warning: Detaching a physical volume reduces the availability of data
within the logical volumes residing on that disk.
Prior to detaching a physical volume or the last available path to it,
verify that there are alternate copies of the data
available on other disks in the volume group.
If necessary, use pvchange(1M) to reverse this operation.
Physical volume "/dev/dsk/c13t0d0" has been successfully changed.


root@bfssgmt [/]> lvdisplay -v /dev/vgsgm/lvacc
--- Logical volumes ---
LV Name /dev/vgsgm/lvacc
VG Name /dev/vgsgm
LV Permission read/write
LV Status available/syncd
Mirror copies 1
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 500
Current LE 125
Allocated PE 250
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/c12t0d0 125 125
/dev/dsk/c13t0d0 125 125

--- Logical extents ---
LE PV1 PE1 Status 1 PV2 PE2 Status 2
00000 /dev/dsk/c12t0d0 04090 current /dev/dsk/c13t0d0 02554 current
Robert-Jan Goossens
Honored Contributor

Re: pvchange OR lvreduce - what should I use to Break Mirrors

Duhh I don't think you can.

http://docs.hp.com/en/7161/LVM_OLR_whitepaper.pdf

--
Since attached devices can potentially be accessed by LVM at any time, they must first
be detached before they can be safely replaced or before diagnostics can be run on
them. A detached device is still part of the volume group but it is not accessed by LVM.
Detaching a device directs LVM to conclude any LVM operations pending to the device
and prepare for the device to be replaced. Formerly, without LVM OLR, devices were
detached only when the volume group was deactivated, consequently a volume group
had to be deactivated before servicing a disk or path.
--

What does dmesg say?

Do you see an error like below?

LVM: VG 64 0x010000: PVLink 188 0x072000 Detached.
Siju Vadakkan
Trusted Contributor

Re: pvchange OR lvreduce - what should I use to Break Mirrors

The issue is you have alternative link for those disks.

When u deactivate one link, it fails over to the alternative link.so You have to deactivate primary and alternative links of the disks.

#pvchange -a n
#pvchange -a n

Siju Vadakkan
Trusted Contributor

Re: pvchange OR lvreduce - what should I use to Break Mirrors

The issue is you have alternative link for those disks.

When u deactivate one link, it fails over to the alternative link.so You have to deactivate primary and alternative links of the disks.

#pvchange -a n
#pvchange -a n

Eg: Here is one disk with primary and alternative link.
-----------------
PV Name /dev/dsk/c6t1d3
PV Name /dev/dsk/c8t1d3 Alternate Link

# pvchange -a n /dev/dsk/c6t1d3
# pvchange -a n /dev/dsk/c8t1d3