Operating System - HP-UX
1753690 Members
5001 Online
108799 Solutions
New Discussion юеВ

Ideas on splitting a volume group

 
SOLVED
Go to solution
Smucker
Regular Advisor

Ideas on splitting a volume group

I need ideas on how to do this. We will be migrating toa new box and I would like to split up a volume group. Our VG01 has an app lvol and a data lvol. I need to move the data lvol to the new machine but not the app lvol. Yes I can back up and restore but that would take too long.

Could I do the following:

Map the new disk to both machines and mirror the data lvol. Break the mirror then reduce the Volume group on machine A . On machine B create a volume group with the same operands (not the same major number) and lvcreate the boken mirror disk. fsck the lvol and mount.

will this work
4 REPLIES 4
Ninad_1
Honored Contributor
Solution

Re: Ideas on splitting a volume group

Ok, lets try this.
1. Add the new disk/disks to the VG01 on host1 which has the data and app lvols using vgextend
2. Mirror the data lvols on the new disk/disks using lvextend and allow the lvols to be mirrored.
3. Remove the mirror copy from the original disk/disks for the data volumes using lvreduce and mentioning the pv_paths for the original disks
4. Create a map file for VG01 using vgexport -p -m mapfile
5. Stop the activity on the data lvols.
6. Remove the new disk/disks from host1
7. Remove the PVs from VG01 using vgreduce -f to forcibly remove the missing PVs
8. Delete the device special files corresponding to the disks which were removed on host1, using rmsf
9. On host 2 add the new disk/disks removed from host1, do a ioscan -fnC disk and insf -e to make disks visible and create the device files
10. Create /dev/VG01 , create group file in /dev/VG01 with unique minor number [ Not unique major number as you have mentioned ] using mknod
11. Do a vgimport giving names of the disks and use the mapfile
12. Activate the VG with vgchange -a y -q n to ignore the quorum requirement.
13. Remove the missing PVs using vgreduce -f
14. I am not sure how the vgimport will work and will the VG still have the info on other lvols - non data lvols - if yes then remove using lvreduce -f

I think this should be it.

But let the experts validate this approach.
Also its always better to have a backup taken before carrying out this procedure.

Regards,
Ninad
Mridul Shrivastava
Honored Contributor

Re: Ideas on splitting a volume group

1. The device file name would be different at hosts so If u r not comfortable with giving device file name while importing the vg, I would suggest you to use the following command while exporting the vg:
# vgexport -p -s -m /tmp/vg01.map
then ftp this file and execute the following command:
#vgimport -p -s -m /tmp/vg01.map

2. Other thing you can try is after you extend lv and mirror it, do a lvsplit on the same. It will create one more copy of the LV and then execute vgreduce on this disk.
Vgcreate on other host then do lvcreate and map PE's to LE's as they were earlier.
Please don't create newfs on this as it will destroy data. After we r finished with PE to LE mapping u can mount the lv after executing fsck on the same.
Time has a wonderful way of weeding out the trivial
Jakes Louw
Trusted Contributor

Re: Ideas on splitting a volume group

Or you could create a unique VG and an LVOL on the new server, do the NEWFS then do one of two things:
1) NFS mount to the old server and do a copy using CPIO
2) Share the disk, and assuming you have created the VG on the new server with a unique name, vgimport and activate the VG on the old server. Then use DD to copy the old LVOL to the new LVOL, test it to see if it mounts on a dummy mount-point, then unshare and mount on the new server.
Trying is the first step to failure - Homer Simpson
Smucker
Regular Advisor

Re: Ideas on splitting a volume group

thanks, Sorry so long to assign points