Operating System - HP-UX
1822144 Members
3390 Online
109640 Solutions
New Discussion

Change VG name and upgrade LVM version

 
SOLVED
Go to solution
support_billa
Valued Contributor

Change VG name and upgrade LVM version

hello,

 

I want to change VG name and upgrade LVM version.  i extend following thread Change VG name , i hope i don't forget nothing ?

 

1) First Umount all logical volumes

2) deactivate the volume group vgold_name
   vgchange -a n vgold_name

3) preview export vgold_name from system by
   vgexport -p -s -v -m /tmp/vgold_name.map vgold_name

this will remove information of vgold_name and its corresponding PV entries from file /etc/lvmtab.
And -m option will make a mapfile(copy) having names of lvols that was present in vgold_name and -s option will add an addtional
line having VG-ID into the same map-file.  But keep remember that this -s option works only if u want to perform this task on
the same system means if u want to export and import vg on the same system or over the sharable systems(in cluster environment)

4) mkdir /dev/vgnew_name

5) LVM Version Upgrade
   Yes : LVM 2: Major_Nr 128
   No  : LVM 1: Major_Nr 64

6) Get Minor of actual VG

7) # mknod with LVM 1
   mknod /dev/vgnew_name/group c 64 0x010000

8) export vgold_name from system by
   vgexport -s -v -m /tmp/vgold_name.map vgold_name

9) vgimport -v -m /tmp/vgold_name.map vgnew_name

10) to save the lvm header information of new volume group vgnew_name into the lvm header backup file
   i.e. /etc/lvmconf/vgnew_name.conf

   vgcfgbackup vgnew_name

11) Now re-activate the vgnew_name
   vgchange -a y vgnew_name

12) edit /etc/fstab

13) Mount all logical volumes


5 REPLIES 5
James R. Ferguson
Acclaimed Contributor
Solution

Re: Change VG name and upgrade LVM version

Hi:

 

Step-2 is not necessary for step-3.  Doing a preview 'vgexport' does not require volume group deactivation, nor does it alter the '/etc/lvmtab'.  The '-s' option adds the VGID of the volume group to the mapfile which is useful for 'vgimport'ing on both the same or a different server.

 

Step-6: You need only look at the device file to obtain this.

 

Step-7: You show a minor number of '01' as for a volume group named 'vg01'.  This has nothing to do with the LVM version.  As you show, LVM 1.0 uses a *major* number of 64; LVM 2.x a major number of 128.  No doubt you are starting with LVM version 1.0 and at this point you want the major number to remain 64.  The LVM migration is a whole separate task (see below).

 

Step-9: You want to add the '-s' option too to actually use the VGID placed in the mapfile to match the physical disks on your system and update '/etc/lvmtab'.

 

As for updating the LVM version, this is a separate task.  You should read the "LVM Volume Group Version Migration" guide:

 

http://bizsupport.austin.hp.com/bc/docs/support/SupportManual/c01916196/c01916196.pdf

 

Regards!

 

...JRF...

support_billa
Valued Contributor

Re: Change VG name and upgrade LVM version

hello,

 

thx for the answer , i read "LVM Volume Group Version Migration" guide".

so i can do "vgversion ...." before

 

step 11) Now re-activate the vgnew_name
   vgchange -a y vgnew_name

 

but i have to be careful, no LVM Version downgrade  is possible , right ?

 

regards

James R. Ferguson
Acclaimed Contributor

Re: Change VG name and upgrade LVM version


@support_billa wrote:

so i can do "vgversion ...." before

 

step 11) Now re-activate the vgnew_name
   vgchange -a y vgnew_name

 

but i have to be careful, no LVM Version downgrade  is possible , right ?


It's your choice whether or not you change the volume group name before or after migrating to the newer LVM version.

 

As far as I know there is no LVM version downgrade.  After all, once you have the new limits in place, why would you want to constrain yourself?  Any downgrade code would have to verify that the old limits were not exceeded for that matter.

 

[EDIT:]  Well, I was wrong.  On page-10 of the guide I cited is a section titled "Reverting back to Version 1.0".

 

Regards!

 

...JRF...

support_billa
Valued Contributor

Re: Change VG name and upgrade LVM version

hello,

 

a new step :

14) edit /etc/lvmrc

 

regards

James R. Ferguson
Acclaimed Contributor

Re: Change VG name and upgrade LVM version



a new step :

14) edit /etc/lvmrc

 


Yes, as described on page-6 of he "LVM Volume Group Version Migration" guide:

 

http://bizsupport.austin.hp.com/bc/docs/support/SupportManual/c01916196/c01916196.pdf

 

See also, page-10 which says that you *can* downgrade to version 1.0

 

Regards!

 

...JRF...