1855597 Members
1965 Online
104112 Solutions
New Discussion

Re: VGEXPORT/VGIMPORT

 
Aggy
Frequent Advisor

VGEXPORT/VGIMPORT

I have got 20 logical volumes on an existing VG – vgprod01
We want to move all the data from vgprod01 to the new added disk.
i.e
ioscan –funCdisk
disk 1 0/0/0/0.1.0 sdisk CLAIMED DEVICE HP Virtual Disk
/dev/dsk/c0t1d0 /dev/rdsk/c0t1d0
disk 2 0/0/0/0.2.0 sdisk CLAIMED DEVICE HP Virtual Disk
/dev/dsk/c0t2d0 /dev/rdsk/c0t2d0

Move the data and the structure from c0t2d0 to c0t1d0

We want to do this ASAP and as restore takes much time I want to do a sequential copy.
I have just created 20 new temp logical volumes on a tmpvgprod which is on c0t1d0
After I copy the data from Vgprod to tmpvgprod I want to UMOUNT vgprod and rename tmpvgprod as VGPROD and also rename the tmp logical volume in it to the exisitn logical volumes.Which is the best way I can rename the tmpvgprod and tmplogical volumes to the old names and get rid of c0t2d0 – I think VGEXPORT AND VGIMPORT is solution
2) But will I loose the copied data if I use VGEXPORT/IMPORt
9 REPLIES 9
freddy_21
Respected Contributor

Re: VGEXPORT/VGIMPORT

yes correct.

do this command:
1. create map file for tmpvgprod
# vgexport -v -s -p -m tmpvgprod.map tmpvgprod
2. umount all disk at vgprod1
3. deactivate tmpvgprod and vgprod1:
# vgchange -a n tmprod1
# vgchange -a n vgprod1
4. export disk tvgmprod and vgprod1
# vgexport tmpvgprod
# vgexport vgprod1
5. create device for vgprod1
# mkdir /dev/vgprod1
# mknod /dev/vgprod1/group c 64 0x010000
note : about minor number be carefull must identic. cant same with the other vg. make same with original minor number
6. import map file
# vgimport -v -s -m tmpvgprod.map vgprod1


good luck
freddy
Steven E. Protter
Exalted Contributor

Re: VGEXPORT/VGIMPORT

Shalom,

You might find this faster:

1) add the disk c0t2d0 to the same vg as c0t1d0
2) lvextend -m 1 /dev/dsk/c0t2d0 for each logical volume.
3) break the mirror with lvsplit
4) vgreduce the disk out of the volume group.
5) Create a new volume group with disk c0t2d0

You should now have a completely usable copy of production data.

Bottom line however, is you need to do a full backup no matter what method you choose. You never know when something is going to go wrong and you need a reliable copy of your data. Though painful, I often wrote a tape, did my new logical volume structure and then restored the tape, which took forever.

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
freddy_21
Respected Contributor

Re: VGEXPORT/VGIMPORT

yes correct.

do this command:
1. create map file for tmpvgprod
# vgexport -v -s -p -m tmpvgprod.map tmpvgprod
2. umount all disk at vgprod1
3. deactivate tmpvgprod and vgprod1:
# vgchange -a n tmprod1
# vgchange -a n vgprod1
4. export disk tvgmprod and vgprod1
# vgexport tmpvgprod
# vgexport vgprod1
5. create device for vgprod1
# mkdir /dev/vgprod1
# mknod /dev/vgprod1/group c 64 0x010000
note : about minor number be carefull must identic. cant same with the other vg. make same with original minor number
6. import map file
# vgimport -v -s -m tmpvgprod.map vgprod1

the data will be save when u run vgexport and vgimport. Dont forget to create map file.

good luck
freddy
freddy_21
Respected Contributor

Re: VGEXPORT/VGIMPORT

yes correct.

do this command:
1. create map file for tmpvgprod
# vgexport -v -s -p -m tmpvgprod.map tmpvgprod
2. umount all disk at vgprod1
3. deactivate tmpvgprod and vgprod1:
# vgchange -a n tmprod1
# vgchange -a n vgprod1
4. export disk tvgmprod and vgprod1
# vgexport tmpvgprod
# vgexport vgprod1
5. create device for vgprod1
# mkdir /dev/vgprod1
# mknod /dev/vgprod1/group c 64 0x010000
note : about minor number be carefull must unique. cant same with the other vg. make same with original minor number
6. import map file
# vgimport -v -s -m tmpvgprod.map vgprod1

the data will be save when u run vgexport and vgimport. Dont forget to create map file.

good luck
freddy
freddy_21
Respected Contributor

Re: VGEXPORT/VGIMPORT

yes correct.

do this command:
1. create map file for tmpvgprod
# vgexport -v -s -p -m tmpvgprod.map tmpvgprod
2. umount all disk at vgprod1
3. deactivate tmpvgprod and vgprod1:
# vgchange -a n tmprod1
# vgchange -a n vgprod1
4. export disk tvgmprod and vgprod1
# vgexport tmpvgprod
# vgexport vgprod1
5. create device for vgprod1
# mkdir /dev/vgprod1
# mknod /dev/vgprod1/group c 64 0x010000
note : about minor number be carefull must unique. cant same with the other vg. make same with original minor number
6. import map file
# vgimport -v -s -m tmpvgprod.map vgprod1
7. activate vgprod1
the data will be save when u run vgexport and vgimport. Dont forget to create map file.

good luck
freddy
freddy_21
Respected Contributor

Re: VGEXPORT/VGIMPORT

sorry network problem. so i post 4 message for this case.

Please refer to the last posting.
Torsten.
Acclaimed Contributor

Re: VGEXPORT/VGIMPORT

The important point:

"Move the data and the structure from c0t2d0 to c0t1d0" - it's not good to just copy the files in terms of permissions and owners. A better solution is to take a backup (tar,...) and restore it to the new disk - but you don't want it.

But I would just add c0t2d0 to the vgprod01, mirror all LVOLs to this disk, remove the mirror copies from c0t1d0, remove this disk from your vg.
All your LVOLs are now "moved" from c0t1d0 to c0t2d0.

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!   
Darrel Louis
Honored Contributor

Re: VGEXPORT/VGIMPORT

Hi Aggy,

The best solution I wanted to mention has already been done by Steven.
It's a faster procedure and less errors can be made.

Darrel
Torsten.
Acclaimed Contributor

Re: VGEXPORT/VGIMPORT

If I look at freddys post, I guess it will only "rename" the LVOLs inside vgprod01 using the LVOL names of tmpvgprod, right?

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!