Operating System - HP-UX
1834391 Members
2062 Online
110066 Solutions
New Discussion

Questions about remove mirror image on LVM will affect package.

 
Kenny Chau
Trusted Contributor

Questions about remove mirror image on LVM will affect package.

Hi all,

I would like to ask that I had some LVMs (mirrored) running on a package. If I want to remove the mirror image and form a 1 VG from 2 HDs(original 2 HDs for mirror), what things that I need to pay attention to?

Thanks very much.
Kenny
8 REPLIES 8
Frederic Sevestre
Honored Contributor

Re: Questions about remove mirror image on LVM will affect package.

Hi,

You will have to remove the mirror on one node. Then on the other node you will have to vgexport/vgimport the modified vg.

On node A :
# lvreduce -m 0 /dev// /dev/dsk/cxtydz

for all the LV where cxtydz is the disk you want to remove from the vg

# vgreduce /dev/dsk/cxtydz
repeat those steps for the other disk

# vgexport -v -p -m mapfile
# rcp mapfile :/tmp/mapfile

On node B :
# vgexport
# mkdir /dev/
# mknod /dev//group c 64 0x....
# vgimport -v -m /tmp/mapfile

Then create the other vg on one node and import it on the other.

Fr??d??ric


Crime doesn't pay...does that mean that my job is a crime ?
John Waller
Esteemed Contributor

Re: Questions about remove mirror image on LVM will affect package.

One thing to remember is thet the whole idea of ServiceGuard is to safeguard against a single point of failure (SPOF). By removing the mirror you are introducing a SPOF
a single disk).
Also if you decide to continue and not buy more disks, make sure you do not remove the ServiceGuard lock disk and also remember to make the same changes to the VG on all other nodes within the cluster which will activate the VG. (vgexport and vgimport commands)
Paula J Frazer-Campbell
Honored Contributor

Re: Questions about remove mirror image on LVM will affect package.

Hi Kenny,

Before doing anything backup the data.

It depends how the mirror is set up, if it is just two disks one directly mirrored to the other then the mirror can be split with no problems.

If not then the answer depends upon how the mirror is set up.


Paula
If you can spell SysAdmin then you is one - anon
Kenny Chau
Trusted Contributor

Re: Questions about remove mirror image on LVM will affect package.

Thanks all, I think Frederic solution may work, but I did not test it. I will let you know after I tested it.

For my situation, my HD is mirrored like this:

--- Logical volumes ---
LV Name /dev/vg05/lvol1
LV Status available/syncd
LV Size (Mbytes) 17000
Current LE 4250
Allocated PE 8500
Used PV 2


--- Physical volumes ---
PV Name /dev/dsk/c3t10d0
PV ame /dev/dsk/c5t10d0 Alternate Link
PV Status available
Total PE 4340
Free PE 90

PV Name /dev/dsk/c5t11d0
PV ame /dev/dsk/c3t11d0 Alternate Link
PV Status available
Total PE 4340
Free PE 90

My HD is 18G each (mirrored). I want to cut the mirror and extend the VG to 36G. I think John is right too. If I did not halt the package before proceeding, the package will switch from one node to another. So what else I need to pay attention to?

Thanks very much.

Kenny.
Kenny
Stephen Doud
Honored Contributor

Re: Questions about remove mirror image on LVM will affect package.

From what I understand, you want to remove a mirror and grow the
logical volume by the mirror space returned to the pool. The
solution is:

# lvreduce -m 0 /dev/vg05/lvol1
(removes the mirror /dev/dsk/c5t11d0 from the lvol (but it is
still a member of vg05))

Now, add the freed-up space to lvol1:
# lvextend -l 8500 /dev/vg05/lvol1

If there is a file system in lvol1 that must be grown to fill the
extra space in lvol1, Advanced/Online JFS must be resident on the
system if it is necessary to grow it with the package running.

Finally, because the logical volume size and mirroring information
is only held in the LVM structures on the disks, no system files
need to be updated other than the LVM backup files
(vgcfgbackup(1m)).
Kenny Chau
Trusted Contributor

Re: Questions about remove mirror image on LVM will affect package.

Thanks Stephen, should I need to vgexport the map file to other node after I finished this task?

Thanks.
Kenny
Sanjay_6
Honored Contributor

Re: Questions about remove mirror image on LVM will affect package.

Hi Kenny,

When you want to remove the mirror disk from the VG, the vg info gets modified on the system on which this configuration is performed. You should replicate this change across the other cluster nodes where the package using this VG gets activated. To do this, You have to do a vgexport in shared mode on the configuration node and do a vgimport on the other cluster nodes. You also have to make sure the /etc/lvmpvg file is updated if you were using pvg strict mirroring ealier and now you don't, since you have removed the mirror copy. On the package configuration side you don't have to do anything until you are removing and lv or adding one. You just have to make sure that the vg info is replicated properly across the other nodes.

Hope this helps.

Regds

Do note that you are going to break a cardinal rule in MC/SG. Using a VG in a packge where the VG/LV is not mirrored. This defeats the idea of redundancy.
Sanjay_6
Honored Contributor

Re: Questions about remove mirror image on LVM will affect package.

Hi Kenny,

I was just going through your post and on second thought i think it should be okay for you to remove the mirror. Seems like you have this mirror on a disk array so there are two paths to the disk and the lun is obviously a raid subsystem. So you can reduce the mirror. First do a lvreduce followed by a vgreduce for the disk and then export the vg map on the configuration node and import it on the other cluster nodes.

Hope this helps.

Regds