1827794 Members
2677 Online
109969 Solutions
New Discussion

lvsplit command

 
Amitava_HP-UX
Advisor

lvsplit command

Hi
I have a VG with a disk A in it. I have added disk B in that VG. I mirrored all the LV in A to B. Now I want to split the mirror in such a way that all the LV with the present name should remain on disk B [ like lvol1 ] & the lvs in disk A come up with names like lvol1b. My intension is the storage migration without taking downtime of the database. Presently the DB is on disk A & I want to move it in disk B.
Can we specify disk device name in lvsplit command? Pls help
6 REPLIES 6
Steven E. Protter
Exalted Contributor

Re: lvsplit command

Shalom,

The command lvsplit breaks a mirror based on the disks its currently on. To achieve these results you should break the mirror and then lvextend -m 1 specifying the target disk as the second mirror copy.

Then the normal lvsplit command or mirror reduction with lvextend -m 0 will work.

Note however, that a database such as oracle must be DOWN for this type of replication to preserver the data.

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
Annelise Wilken
Regular Advisor

Re: lvsplit command

Hi Amitava,

We perform online backups by splitting the logical volumes so we have a mirrored logical volume called disk1:

lvsplit /dev/vg01/disk1 thid creates a second logical volume called /dev/vg01/disk1b - we then fsck /dev/vg01/disk1b mount it to a temporary mount point:

mount /dev/vg01/disk1b /tmp_mnt we can then back the system up whilst users are still "using" the system (they write/read from /dev/vg01/disk1")

Once the disk1b backup completes we umount /tmp_mnt and then merge the logical volumes:

lvmerge /dev/vg01/disk1b /dev/vg01/disk1 - this "synch" the splitted logical volume with the "master" with no downtime ...... is this what you want to do?

Amitava_HP-UX
Advisor

Re: lvsplit command

No this is not what I want to do. I want to do a entire storage migration without taking any downtime of the DB. Now DB is running on Disk A. I want to shift it to Disk B in new storage. I am planning to extend VG of A into Disk B. Set mirror of LVs A to B. Then do A LV split in such a way that lvol1 in the mirrorset will form lvol1b in Disk A & lvol1 will remain in Disk B. Then without distrubing the DB we will remove Disk A from the Vg & the entire DB will be keep on running on disk B.
My challange is how can i split the missorset of LV by specifying the disk which i want to remove. I dont want to do a lvreduce for the roll back operation purpose.
Mancboy
Valued Contributor

Re: lvsplit command

I don't think you want to do an lvsplit at all here.

Correct me if I'm wrong, but all you are doing is migrating data from disc A to disc B?

All you need to do is a vgextend to add the new disc, then pvmove the LVs onto the new disc:
1) vgextend vgDB /dev/dsk/discB

THEN

2) pvmove -n /dev/vgDB/lvolX /dev/dsk/discA /dev/dsk/discB
and do that for each LV

OR

2) pvmove /dev/dsk/discA /dev/dsk/discB to move everything from disc A to discB
Amitava_HP-UX
Advisor

Re: lvsplit command

I am agreed with you. But in case of pvmove i will not have any data for rollback. in case of lvsplit atleast i have another copy of data with the changed lvname.
I am not sure but in case of pvmove is it possible if A & B are different size LUN?
Mancboy
Valued Contributor

Re: lvsplit command

If you're truly concerned with a backup of it (and I'm assuming that you're backing it up to tape too!)

You can just create the mirror and pull the disc - I've done this countless times while trying to migrate servers from one room to another and never seen anything other than syslog say "disc is not there".

I used to pull a disc from one mirrored VG on one machine, and inserted it in another mirrored VG in another server - this went on for about a month on a few boxes.

To finally get shut of the original disc from the VG use:
vgreduce -f /dev/vgDB (this will remove all links to your old disc A).

One word of caution though:
ensure that you backup the configs first:
1) vgcfgbackup vgDB
2) vgexport -m vgDB.mapfile -p -v vgDB.discfile vgDB