1753809 Members
8727 Online
108805 Solutions
New Discussion юеВ

Re: Clone lvol in SAN

 
Laszlo Csizmadia
Frequent Advisor

Clone lvol in SAN

I have question. There is two HP servers, an EMC Clariion storage and SAN. I want to clone vg01/lvol1 of server1. lvol1 resides on a Clariion's LUN100 on which may resides (partially) other lvols of vg01. I clone LUN100 to LUN200 within Clariion. No problem. I see the clone disk (LUN200) on server2. Ioscan, insf OK. But how to see the data? How to import VG infos into server2? Is it possible? I don't want to clone all lvols in vg01 so the whole vg01 of server1. This might be easy. There is no lvexport/lvimport in LVM. Is it possible somehow?
Any idea will be appreciated. Thanks.
5 REPLIES 5
Steven E. Protter
Exalted Contributor

Re: Clone lvol in SAN

import and export are command by volume group.

vgimport
vgexport

I've never seen lvimport, doesn't mean it doesn't exist, just mens I've never seen it.

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
Michael Tully
Honored Contributor

Re: Clone lvol in SAN

I think whgat your after is to use a product called 'snapview' from EMC. It is similar to the timefinder/BCv concept provided with the EMC symmetrix. Depending on your model clariion, as to whether it is supported. What is done, is the each cloned volume, is split off from server 1 and you can mount it on server 2

To split the data would require using 'vgchgid' and the the mapfiles using the vgexport/vgimport concept. you can't break up a volume group to do this, but it is up to you what you ultimately present to the second server.

Regards
Michael
"When I have trouble spelling, it's called fat finger syndrome."
Anyone for a Mutiny ?
Massimo Bianchi
Honored Contributor

Re: Clone lvol in SAN

Hi,
here is a very very unsupported and try-at-your-risk procedure.

You must have deep knowledge of lvm and a bit of luck.

You have got the lun.

Now create a new vg with that lun and create the lvol1 exactly as on your original VG, same size, same disposition of PE.

This may involve spending time examining the PVDISPLAY -v output and creating some unusefull lvol ro reflect the situation.


now to and fsck -o -m full on /dev/vgNEW/lvol1.

you shuold have your data back :)


This worked for me many times, because information about fs structure is stored in the lvol, and when you clone it it still resides.

the fsck is needed for many reasons.

HTH,
Massimo
Massimo Bianchi
Honored Contributor

Re: Clone lvol in SAN

Hi,
just forgot to say that you have to do the pvcreate on the disk, otherwise the vgcreate will fail. But pvcreate and vgcreate do not touch data, fortunatly

after that the lvcreate.

If you can give this a try... :)

Massimo

Bruno Vidal
Respected Contributor

Re: Clone lvol in SAN

Hi,
It is exactly what said Massimo. You should:
1. pvcreate the lun
2. vgcreate, but take care of the PE size, it should be the same than the orignal vg.
3. lvcreate with at least the same size (if it is bigger you don't care). the important thing is that all PE are in the same order than the original. If it is a standart lvol that reside on the whole lun there is no risk (if it is a distributed lvol or strippe, it is a far complicated but you have to write a script to lvextend each PE).
4. fsck -o full is only necessary if the copy has been done while the fs was mounted. If you do it while the fs was unmounted, the fs is still clean.
5. mount.

Cheers.