Operating System - HP-UX
1855240 Members
4466 Online
104109 Solutions
New Discussion

vgimport from old vgname to new vgname

 
SOLVED
Go to solution
Christopher Hildrum_1
Frequent Advisor

vgimport from old vgname to new vgname

I am migrating data to a new IBM Shark disk array. I have added the new disks to the existing server, created a new vg (vg20) and copied the data to the new volume group. (Data copied cp -pr from vg01 and vg02 to vg20)
Can I vgexport vg01 and vg02 with mapfiles - which I won't need anymore, then vgexport vg20 and vgimport vg20 using the vg02 volume group name? We would like to use the vg02 volume group name as a standard for our Shark connections. Any ideas ?

Thanks -
Chris
14 REPLIES 14
Pete Randall
Outstanding Contributor

Re: vgimport from old vgname to new vgname

Absolutely! That's exactly the way to do it.

Pete

Pete
Patrick Wallek
Honored Contributor
Solution

Re: vgimport from old vgname to new vgname

Yes you can do this quite easily.

Assuming vg01 and vg02 are already exported.

# vgchange -a n /dev/vg20

# vgexport -p -v -s -m mapfilename /dev/vg20
After you are sure that this does what you want, redo the command without the '-p' so that vg20 definitions get removed from the machine.

# mkdir /dev/vg02

# mknod /dev/vg02/group c 64 0x020000

# vgimport -m mapfilename -s -v /dev/vg02

# vgchange -a y /dev/vg02

And you are done.
Marco Santerre
Honored Contributor

Re: vgimport from old vgname to new vgname

yes you can do that.
Cooperation is doing with a smile what you have to do anyhow.
A. Clay Stephenson
Acclaimed Contributor

Re: vgimport from old vgname to new vgname

You can even go beyond that and manually edit the mapfile to change the LVOL names as well; LVM doesn't mind at all.

The only real requirement is that you choose a unique minor device number for the volume group node. By convention, vg02 using 64:0x020000, vg03 uses 64:0x030000, vg04 uses the 64:0x040000 major:minor device tuple but that is just to make things easier for us dumb humans.
If it ain't broke, I can fix that.
Helen French
Honored Contributor

Re: vgimport from old vgname to new vgname

As explained above you can perform this task. But if you are concerned about only the *mount_points*, like you get the output of bdf, then all you need to is to change the entry in /etc/fstab. Also, if you have lot of disks included in the VG, then export and import using -s option.
Life is a promise, fulfill it!
Christopher Hildrum_1
Frequent Advisor

Re: vgimport from old vgname to new vgname

Thanks all -

I forgot to remove the -p option when I vgexported vg01 and vg02 - how do I remove these from the system safely?
Helen French
Honored Contributor

Re: vgimport from old vgname to new vgname

The -p option is for preview. So, when you did vgexport, it didn't actually exported instead, only previewed it. All you need to do is:

# vgexport /dev/vg01
# vgexport /dev/vg02

This will remove the VG information from /etc/lvmtab and thus from the system.
Life is a promise, fulfill it!
Christopher Hildrum_1
Frequent Advisor

Re: vgimport from old vgname to new vgname

Patrick -

following your instructions I get the message:
vgimport: Unable to read the physical volume

Chris
Patrick Wallek
Honored Contributor

Re: vgimport from old vgname to new vgname

Got any disk problems? It would appear that it is trying to read a disk but can't for some reason.
P.H. Vogt
Advisor

Re: vgimport from old vgname to new vgname

Ai If you already did the vgexport command you have to find the disks that belonged to the vg20 VG and add them to the vgimport command.

man vgexport will tell you about the -m and -f options those are very handy. Makes a vgimport command a lot easier.

If all the ESS disks, you assigned to the system, were also in the vg20 VG it is still easy just try

vgimport -m vg02
/dev/dsk/c#t#d# .......

is a list of logical volumes and is always created when executing a vgexport command. If you did not use the -m option it will be saved in the dir. you where when giving the vgexport command.

/dev/dsk/c#t#d# .... are all the disks from the vg20 group.

Paul
man man
Christopher Hildrum_1
Frequent Advisor

Re: vgimport from old vgname to new vgname

Patrick and all -

OK - My dumb human mistake :

I forgot the -s option on the vgexport - so I had to manually re-add the vg20 volume group then vgexport with the -s option .

Everything worked correct and easy.

Thanks all !

Chris
Helen French
Honored Contributor

Re: vgimport from old vgname to new vgname

For the vgimport error, this document might help you TKB #KBRC00009160:

http://forums.itrc.hp.com/cm/PostAnswer/1,,0xe95435a43b46d71190080090279cd0f9,00.html
Life is a promise, fulfill it!
Christopher Hildrum_1
Frequent Advisor

Re: vgimport from old vgname to new vgname

P.H. Vogt -

I should have done it your way - I get it now!

Thanks !
S.K. Chan
Honored Contributor

Re: vgimport from old vgname to new vgname

Sounds like you got a corrupted LVM header. Try one thing .. it may/may-not help .. ie recreate /etc/lvmtab. Make a copy of that file and run "vgscan" to recreate it, then try the vgimport again. Before that check if vg02 is in /etc/lvmtab and just make sure /dev/vg02/group has been created properly. If that does not work it may be disk problem (like what Patrick said).