Operating System - HP-UX
1753501 Members
5043 Online
108794 Solutions
New Discussion юеВ

Re: lvsplit and use "b" lvols in new vg

 
SOLVED
Go to solution
Steve Faidley
Valued Contributor

lvsplit and use "b" lvols in new vg

Does anyone have a clean way to mirror disks, then use the mirror for another VG using HP mirroring? (Can't do it at the array level as they are on different arrays). I have tried lvsplit and use the "b" lvols as a new VG?
I have found I can vgexport the original VG and vgchgid the "b" lvol disks and import them as a new vg using -f vgY.dev, and import the original vg using -f vgX.dev. The only problem is LVM states that it is missing disks, yet vgdisplay does not show the 2nd disk and I can not vgreduce the second disk.
Otherwise I can mount the new VG and use it. Just concerned about the errors it logs. Otherwise it actually seems to work fine.

This is on a PA Superdome Cluster running 11.11

If it ain't broke, let me have a look at it.
4 REPLIES 4
Eric SAUBIGNAC
Honored Contributor
Solution

Re: lvsplit and use "b" lvols in new vg

Bonjour Steve,


--> I guess vgY.dev contains only the disks that have the "b" lvol


--> I guess vgX.dev contains only the disks that do have the "source" lvol, not the "b" lvol.

In order to clean this situation I think you should :

- with lvremove remove "b" lvol on vgX. Normally, with "lvdisplay -v" you should see "???" in place of the usual /dev/dsk/cxxx.

- remove "source" lvol on vgY. Same remark

- Repair those vg with -f option of vgreduce : "vgreduce -f vgX", "vgreduce -f vgY".

You can safely ignore the 4 remarks in output of vgreduce. In place, issue "vgcfgbackup" for the 2 vg, deactivate both, activate both VGs. Every thing should be OK. Notice that with vgdisplay, "Cur PV" is now 1, not 2 as before.

Regards

Eric
skt_skt
Honored Contributor

Re: lvsplit and use "b" lvols in new vg

Just a useful tip ├в ┬ж. If we need to preserve a backup of a file system which is subject to a major change and a BCV option is not available, the following procedure can be followed. This uses LVM mirroring for the same.

Pre-requisites : MirrorDisk/UX software installed in the server.
Sufficient space in a different group of disks for mirroring.

=> Create a spare lv ( temporary one ) to fill up the existing free space of the VG.
=> Add adequate spare disks to the VG.
=> lvextend -m 1 /dev/vgname/lvname
=> lvdisplay -v /dev/vgname/lvname |grep -I stale
To make sure there is no stale LVs.
=> Make sure that there is no data modification happening
In case of a db file system halt the database.
=> lvsplit /dev/vgname/lvname
This will create two lvs as /dev/vgname/lvname and /dev/vgname/lvnameb

=> /dev/vgname/lvnameb can be used as a preserved backup LV.
Can be mounted if require.

=> If require to retrieve data

/usr/sbin/lvmerge dest_lv_path src_lv_path

eg:- to copy data from /dev/vgname/lvnameb back to /dev/vgname/lvname

/usr/sbin/lvmerge /dev/vgname/lvname /dev/vgname/lvnameb

This will result in a single LV /dev/vgname/lvnameb with the old data.

=> lvmerge can be used even if the lvs are not created by a previous lvsplit command also. But the lvs should be of the same size.

Please refer to man page of lvsplit and lvmerge before any such activity.
Steve Faidley
Valued Contributor

Re: lvsplit and use "b" lvols in new vg

It worked perfect, 2nd time around.
First split used half the original disks and half the new disks for the "b" lvols. I had always thought in the past that second set of PEs(disk) always formed the "b" lvol. Maybe a new "feature" added by some patch?
At any rate, resynced and used PVGs to tell it what I wanted.
lvremove'd the "b" lvols
vgdeduce'd the "b" PVs out
pvcreate'dd the "b" PVs
vgcreate'd with "b" PVs
vgextend'd with "b" PVs
lvcreate'd with "b" PVs
fsck'd and mounted.
ALL original data still in lvols!!!!!
(Make sure you create/extend lvols exactly as they were done on the original VG).

Thanks!!!!
If it ain't broke, let me have a look at it.
Steve Faidley
Valued Contributor

Re: lvsplit and use "b" lvols in new vg

It worked perfect, 2nd time around.
First split used half the original disks and half the new disks for the "b" lvols. I had always thought in the past that second set of PEs(disk) always formed the "b" lvol. Maybe a new "feature" added by some patch?
At any rate, resynced and used PVGs to tell it what I wanted.
lvremove'd the "b" lvols
vgdeduce'd the "b" PVs out
pvcreate'd the "b" PVs
vgcreate'd with "b" PVs
vgextend'd with "b" PVs
lvcreate'd with "b" PVs
fsck'd and mounted.
ALL original data still in lvols!!!!!
(Make sure you create/extend lvols exactly as they were done on the original VG).

Thanks!!!!
If it ain't broke, let me have a look at it.