Operating System - HP-UX
1833051 Members
2332 Online
110049 Solutions
New Discussion

Importing a cloned Volume Group

 
SOLVED
Go to solution
David Silvestri
Advisor

Importing a cloned Volume Group

I'm looking to do two things clones in two separate HP-UX environments in the near future.

1. I want to clone a set of luns (all one VG) from one server and mount/import them on another server.

2. I want to clone a set of luns (again all one VG) and import them on the same host as a different VG.

For #1, can I simply do a vgscan and then a vgimport?

For #2, is it the same?

Thanks...

Dave
9 REPLIES 9
Jeff Schussele
Honored Contributor

Re: Importing a cloned Volume Group

Hi Dave,

1) Nope - You need to: A) create the /dev/vg_name dir B) mknod -c 64 0x?????? where ?????? is a unique number not used by an existing VG
And remember to use the -s on both vgexport & vgimport. This assumes these are the *same* LUNs that system A was using that system B can now see. Make sure system A no longer has visibility of these LUNs when you do the destructive vgexport on it.

2) I don't think this will work because at some point you should remove the old VG & that will wipe the VGID off the PVs - but I could be wrong here.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
James R. Ferguson
Acclaimed Contributor

Re: Importing a cloned Volume Group

Hi Dave:

The process of 'vgexport' and 'vgimport' accomodates both. You don't need to 'vgscan'.

In your second question, you are really asking how to change the name of a volume group. To do that:

# unmount the volume group's logical volumes
# vgchange -a n /dev/oldvg
# vgexport -m /tmp/vgmap /dev/oldvg
# mkdir /dev/newvg
# mknod /dev/newvg/group c 64 0xNN0000 #...where N is unique
# vgimport -m /tmp/vgmap /dev/newvg /dev/dsk/pvpath ...
# vgchange -a y /dev/newvg

Regards!

...JRF...
Steven E. Protter
Exalted Contributor

Re: Importing a cloned Volume Group

Shalom Dave,

Your methodology might be a step toward sharing, but cloning? No.

I'd do a vgexport in preview mode, take the map file and use it to import onto the next machine, but this method probably has the same problem.

You might be able to do this on your disk array. EVA-3000 have extensive features for cloning luns. Then present the clone to the second machine.

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
David Silvestri
Advisor

Re: Importing a cloned Volume Group

Thanks for the quick responses... I think I should elaborate a little due to some of the answers.

When I mention cloning, I'm talking about cloning from a back end storage array... not something within HP.

For the second option. I need to clone a drive, and mount it to back it up, on the same server. I was wondering if you can clone the drive, and then import it as a new VG group... i.e. clone vg01 and import as vg99.

Thanks again...

Dave
John Payne_2
Honored Contributor
Solution

Re: Importing a cloned Volume Group

Dave,

You can clone the drive and import it on the same server. The command that accomplishes this is 'vgchgid'.

Once you have the clone presented:

vgchgid /dev/rdsk/cXtXdX
mkdir /dev/vgNN
mknod /dev/vgNN/group c 64 0xnn0000
vgimport /dev/vgNN /dev/dsk/cXtXdX
vgchange -a y vgNN

Then you can mount your logical volumes on whatever filesystems you wanted. The onyl trouble I have ever had with this is that I usually have to do an fsck before mounting the volumes.

Hope it helps
John
Spoon!!!!
John Payne_2
Honored Contributor

Re: Importing a cloned Volume Group

Oops, then the thing I always forget.

vgcfgbackup /dev/vgNN

Good luck
John
Spoon!!!!
sathish kannan
Valued Contributor

Re: Importing a cloned Volume Group

Hi David,
John's step will work perfectly. The only reason you need do fsck is because your source lun in open status i,e it is active. If possible, unmount the source before you start the clone process.


Regards
Sathish
Don't Think too much
David Silvestri
Advisor

Re: Importing a cloned Volume Group

Thanks for all the responses...

I guess it's time to go play :)

Dave
David Silvestri
Advisor

Re: Importing a cloned Volume Group

Using the responses I was directed to the command vgchgid (which I'd never used before).

The man page for the command gives a step by step procedure on how to mount a clone on the same server.

Thanks

Dave