- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Using LVM mirroring to migrate from array to array
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2009 07:10 AM
04-20-2009 07:10 AM
I used physical volume groups to do the mirror. I made a new PVG when I extended the volume group that contained all of the new disks that I presented to the host from the XP12K. I then lvextended each of the LVs in the VG with mirror copy = 1 and specified the new PVG.
My problem is that I can't lvreduce out a physical volume group. It would be easy to remove the XP1024 disks if that was the case. Please help me with the procedure to reduce out these disks:
# vgdisplay -v v42
...
--- Physical volume groups ---
PVG Name vg42_pri
PV Name /dev/dsk/c36t0d0
PV Name /dev/dsk/c36t0d1
PV Name /dev/dsk/c36t0d2
PV Name /dev/dsk/c36t0d3
PV Name /dev/dsk/c36t0d4
PV Name /dev/dsk/c36t0d5
PV Name /dev/dsk/c36t0d6
PV Name /dev/dsk/c36t0d7
PV Name /dev/dsk/c36t1d0
PV Name /dev/dsk/c36t1d1
PV Name /dev/dsk/c36t1d2
PV Name /dev/dsk/c36t1d3
PVG Name vg42_xp1024
PV Name /dev/dsk/c32t0d2
PV Name /dev/dsk/c32t0d4
PV Name /dev/dsk/c32t0d6
PV Name /dev/dsk/c32t1d0
PV Name /dev/dsk/c32t1d2
PV Name /dev/dsk/c32t1d4
PV Name /dev/dsk/c32t0d3
PV Name /dev/dsk/c32t0d5
PV Name /dev/dsk/c32t0d7
PV Name /dev/dsk/c32t1d1
PV Name /dev/dsk/c32t1d3
PV Name /dev/dsk/c32t1d5
----------------------------------------------
casjoh2@baclaw:/home/casjoh2# lvdisplay /dev/vg42/lvol1
--- Logical volumes ---
LV Name /dev/vg42/lvol1
VG Name /dev/vg42
LV Permission read/write
LV Status available/syncd
Mirror copies 1
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 388000
Current LE 24250
Allocated PE 48500
Stripes 0
Stripe Size (Kbytes) 0
Bad block NONE
Allocation PVG-strict/distributed
IO Timeout (Seconds) default
vg42_pri is the PVG containing the XP12K disks.
vg42_xp1024 is the PVG containing the XP1024 disks that I want to remove. There are three LVMs in this VG that I need to take care of and right now all three of them are mirrored between the two PVGs.
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2009 07:25 AM
04-20-2009 07:25 AM
Re: Using LVM mirroring to migrate from array to array
Since LVM mirroring occurs at the logical volume level, you need to work there. You can do:
# lvreduce -m 0 lv_path pv_path
...to target a specific physical volume.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2009 07:50 AM
04-20-2009 07:50 AM
Re: Using LVM mirroring to migrate from array to array
I began reducing out each of the PV Names but once I was done with the first one, the mirror was broken. And I then got an error message telling me that the mirror was no longer established when I started reducing the second PV Name. Do I need to remove the
"-m 0" option after the mirror is broke with the first lvreduce command?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2009 08:13 AM
04-20-2009 08:13 AM
Re: Using LVM mirroring to migrate from array to array
You can querry the pv's with
pvdisplay /dev/dsk/cXtXdX
command to find out which ones have attachments to which logical volumes so that remove these disks from the proper logical volume mirrors.
Hope this helps
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2009 08:48 AM
04-20-2009 08:48 AM
SolutionIf any of the physical volumes are alternate links (pvlinks) your first reduction of the mirror copies to zero whould yield a subsequent error:
lvreduce: "MirrorCopies" parameter "0" is not smaller than existing number "0";
therefore no mirrors are removed.
Using Mel's suggestion, you might do :
# cat ./zappvmirrors
#!/usr/bin/sh
typeset VG=vg42
for PV in c32t0d2 c32t0d4 c32t0d6 c32t1d0 \
c32t1d2 c32t1d4 c32t0d3 c32t0d5 \
c32t0d7 c32t1d1 c32t1d3 c32t1d5
do
for LV in lvol1 lvol2 lvol3
do
pvdisplay -v /dev/dsk/${PV} 2> /dev/null | grep -q /dev/${VG}/${LV} && \
lvreduce -m 0 /dev/${VG}/${LV} /dev/dsk/${PV} || echo "skipped ${PV}:${LV}"
done
done
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2009 09:35 AM
04-20-2009 09:35 AM
Re: Using LVM mirroring to migrate from array to array
This plan absolutely can work.
Its just a matter of using lvextend -m 0 and then -m 1 to reduce the mirrors and create new mirrors on the new disk array.
Note: EVA type arrays come with management tools that can do the job more quickly than mirror/ux which is the tool you are using with lvextend.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2009 10:43 AM
04-20-2009 10:43 AM
Re: Using LVM mirroring to migrate from array to array
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2009 05:21 PM
04-20-2009 05:21 PM
Re: Using LVM mirroring to migrate from array to array
Why did you not just add the new XP luns to the volume group and then just
pvmove /dev/dsk/olddisk
vgreduce /dev/vgXXX /dev/dsk/olddisk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2009 05:50 AM
04-21-2009 05:50 AM
Re: Using LVM mirroring to migrate from array to array
My choice of utilities would be vxdump and vxrestore which are much faster and they do not explicitly destroy the source data as pvmove does. But looks like Mirror-UX worked well for the person who asked the question.
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2009 09:33 AM
04-21-2009 09:33 AM
Re: Using LVM mirroring to migrate from array to array
Hope this helps!
Regards
Torsten.
__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.
__________________________________________________
No support by private messages. Please ask the forum!
If you feel this was helpful please click the KUDOS! thumb below!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2009 12:37 PM
04-22-2009 12:37 PM
Re: Using LVM mirroring to migrate from array to array
Jim, I had been using your script to attempt this. I am essentially trying to run through each logical volume(lvol1-lvol11) and reduce out each of the c4t0d
--- Logical volumes ---
LV Name /dev/vg20/lvol1
VG Name /dev/vg20
LV Permission read/write
LV Status available/syncd
Mirror copies 1
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 7000
Current LE 875
Allocated PE 1750
Stripes 0
Stripe Size (Kbytes) 0
Bad block NONE
Allocation PVG-strict/distributed
IO Timeout (Seconds) default
--- Distribution of logical volume ---
PV Name LE on PV PE on PV
/dev/dsk/c4t0d1 175 175
/dev/dsk/c4t0d2 175 175
/dev/dsk/c4t0d3 175 175
/dev/dsk/c4t0d7 175 175
/dev/dsk/c12t0d1 175 175
/dev/dsk/c12t0d3 175 175
/dev/dsk/c12t0d5 175 175
/dev/dsk/c12t0d2 175 175
/dev/dsk/c12t0d4 175 175
/dev/dsk/c4t0d0 175 175
--- Logical extents ---
LE PV1 PE1 Status 1 PV2 PE2 Status 2
00000 /dev/dsk/c4t0d0 00000 current /dev/dsk/c12t0d1 00000 current
00001 /dev/dsk/c4t0d1 00000 current /dev/dsk/c12t0d3 00000 current
00002 /dev/dsk/c4t0d2 00000 current /dev/dsk/c12t0d5 00000 current
00003 /dev/dsk/c4t0d3 00000 current /dev/dsk/c12t0d2 00000 current
00004 /dev/dsk/c4t0d7 00000 current /dev/dsk/c12t0d4 00000 current
00005 /dev/dsk/c4t0d0 00001 current /dev/dsk/c12t0d1 00001 current
00006 /dev/dsk/c4t0d1 00001 current /dev/dsk/c12t0d3 00001 current
00007 /dev/dsk/c4t0d2 00001 current /dev/dsk/c12t0d5 00001 current
00008 /dev/dsk/c4t0d3 00001 current /dev/dsk/c12t0d2 00001 current
00009 /dev/dsk/c4t0d7 00001 current /dev/dsk/c12t0d4 00001 current
00010 /dev/dsk/c4t0d0 00002 current /dev/dsk/c12t0d1 00002 current
00011 /dev/dsk/c4t0d1 00002 current /dev/dsk/c12t0d3 00002 current
00012 /dev/dsk/c4t0d2 00002 current /dev/dsk/c12t0d5 00002 current
00013 /dev/dsk/c4t0d3 00002 current /dev/dsk/c12t0d2 00002 current
00014 /dev/dsk/c4t0d7 00002 current /dev/dsk/c12t0d4 00002 current
to this:
root@rachp23:/root# lvdisplay -v /dev/vg20/lvol1 | more
--- Logical volumes ---
LV Name /dev/vg20/lvol1
VG Name /dev/vg20
LV Permission read/write
LV Status available/syncd
Mirror copies 0
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 7000
Current LE 875
Allocated PE 875
Stripes 0
Stripe Size (Kbytes) 0
Bad block NONE
Allocation PVG-strict/distributed
IO Timeout (Seconds) default
--- Distribution of logical volume ---
PV Name LE on PV PE on PV
/dev/dsk/c4t0d1 175 175
/dev/dsk/c4t0d2 175 175
/dev/dsk/c4t0d3 175 175
/dev/dsk/c4t0d7 175 175
/dev/dsk/c12t0d1 175 175
--- Logical extents ---
LE PV1 PE1 Status 1
00000 /dev/dsk/c12t0d1 00000 current
00001 /dev/dsk/c4t0d1 00000 current
00002 /dev/dsk/c4t0d2 00000 current
00003 /dev/dsk/c4t0d3 00000 current
00004 /dev/dsk/c4t0d7 00000 current
00005 /dev/dsk/c12t0d1 00001 current
00006 /dev/dsk/c4t0d1 00001 current
00007 /dev/dsk/c4t0d2 00001 current
00008 /dev/dsk/c4t0d3 00001 current
00009 /dev/dsk/c4t0d7 00001 current
00010 /dev/dsk/c12t0d1 00002 current
00011 /dev/dsk/c4t0d1 00002 current
00012 /dev/dsk/c4t0d2 00002 current
00013 /dev/dsk/c4t0d3 00002 current
00014 /dev/dsk/c4t0d7 00002 current
00015 /dev/dsk/c12t0d1 00003 current
00016 /dev/dsk/c4t0d1 00003 current
00017 /dev/dsk/c4t0d2 00003 current
00018 /dev/dsk/c4t0d3 00003 current
00019 /dev/dsk/c4t0d7 00003 current
00020 /dev/dsk/c12t0d1 00004 current
00021 /dev/dsk/c4t0d1 00004 current
00022 /dev/dsk/c4t0d2 00004 current
00023 /dev/dsk/c4t0d3 00004 current
00024 /dev/dsk/c4t0d7 00004 current
At that point, I'm in a bad spot because I now have extents on both the old array and the new array. Not extents on just one or other other. I end up having to pvmove /dev/dsk/c12t0d1(new array) back to /c4t0d0(old array). Then I have to remirror them to get the data back on the new array.
So I'm still stuck on how to break the mirror properly so that I can reduce out the old array disks. This would be ten times easier if lvreduce would take a physical volume group as an option.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2009 12:48 PM
04-22-2009 12:48 PM
Re: Using LVM mirroring to migrate from array to array
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2009 12:53 PM
04-22-2009 12:53 PM
Re: Using LVM mirroring to migrate from array to array
# lvreduce -m 0 /dev/vg20/lvol1 /dev/dsk/c4t0d0 /dev/dsk/c4t0d1 /dev/dsk/c4t0d2 /dev/dsk/c4t0d3 /dev/dsk/c4t0d7
where you list ALL disks you want to remove from the mirror on the command line.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2009 01:09 PM
04-22-2009 01:09 PM
Re: Using LVM mirroring to migrate from array to array
This is the script I'm now using to handle this.
# FILE should contain all the primary links to the disks in the VG
# FILE2 should contain both the primary and alternate links
typeset VG=vg20
# FILE should contain only the primary links
FILE=/tmp/newdisks
# FILE2 should contain both the primary and alternate links
FILE2=/tmp/newdisks2
for LV in 3 4 5 6 7 8 9 10 11
do
echo "Breaking mirrors, lvreducing PVs..."
lvreduce -m 0 /dev/${VG}/lvol${LV} $(cat ${FILE})
done
echo "VGreducing the PVs from $VG..."
vgreduce $VG $(cat ${FILE2})