Operating System - HP-UX
1834648 Members
2814 Online
110069 Solutions
New Discussion

Re: Change of minor number for VG

 
yc_2
Regular Advisor

Change of minor number for VG

Hi,

Is it possible to change the minor number for VG? If possible, how to go about it.


Thanks in advance,
YC
9 REPLIES 9
Patrick Wallek
Honored Contributor

Re: Change of minor number for VG

Why would you want to?

My opinion is that you could change the minor number to the vg??/group file, but then I would think you would have to recreate all of your logical volumes.

You could possibly do a vgexport of your volume group, recreate the /dev/vg?? directory and then recreate the /dev/vg??/group file with the appropriate minor number and then do a vgimport of all your LVs.

That seems like an awfully involved and risky process for a change of questionable value.
yc_2
Regular Advisor

Re: Change of minor number for VG

Hi Patrick,

Reason for changing the minor number of VG is because I want to configure the VG for MC/ServiceGuard. The VGs were created with no intention for MC/SG during then.

I have to make the minor number of the VGs in both node to be the same to configure the VGs for MC/SG. Now the minor number in 2nd node for the VGs are already in used.

YC
Patrick Wallek
Honored Contributor

Re: Change of minor number for VG

OK. I see now.

In thinking further, I think your best bet is the vgexport, recreate /dev/vg??/group, and vgimport.

I would make sure that you have a good backup before you attempt this.
Santosh Nair_1
Honored Contributor

Re: Change of minor number for VG

Leong,

You could change the minor number for a VG by doing a vgexport and then a vgimport.
First you would have to umount all the filesystems on the VG.
Then deactivate the VG, i.e. vgchange -a n VG.
Then vgexport -s -m /tmp/VG.map VG. This exports the VG and creates a mapfile which can be used in the vgimport.
Now, recreate /dev/VG dir and /dev/VG/group with the minor number you want, i.e.:
mkdir /dev/VG
mknod /dev/VG/group c 64 0x0??00000
Reimport the VG, vgimport -s -m /tmp/VG.map VG.
Reactivate the VG, vgchange -a y VG.
And finally remount the filesystems.

That said, its not an absolute requirement that the VG minor numbers be the same. Its recommended this way because its easier to maintain, but you could leave it the way it is and it would still work under SG.

Hope this helps.

-Santosh
Life is what's happening while you're busy making other plans
Sanjay_6
Honored Contributor

Re: Change of minor number for VG

Hi Leong,

You can change the minor no of the vg by first exporting it and then importing it. Do as follows.

Unmount the filesystems corresponding to lv's from old_vg using "umount"
Deactivate the VG
vgchange -a n /dev/old_vg
export the VG map
vgexport -m /tmp/old_vg.map /dev/old_vg
Create the new VG directory and group file
mkdir /dev/new_vg
mknod /dev/new_vg/group c 64 0x0n0000
n==1,2,3...minor no for the new vg
Import the exported map
vgimport -m /tmp/old_vg.map /dev/new_vg
Activate the new VG
vgchange -a y /dev/new_vg
Mount the LV's from this vg using mount and check that they are working okay. Edit your /etc/fstab file to reflect the new changes.

Don't forget to take a complete backup of the old VG before you start this.

Hope this helps.

Thanks
Sridhar Bhaskarla
Honored Contributor

Re: Change of minor number for VG

It's a good idea to keep the same minor numbers for the volume groups in MC/Service Guard. In fact, I would prefer to maintain the same device file names also.

TO change the minor numbers, you have to export the volume group, create the directory and group files with different minor numbers and import them back. We can't change them on-line.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Wodisch
Honored Contributor

Re: Change of minor number for VG

Hello YC,

indeed it is not neccessary to have the same internal VG
number for the VGs on all nodes of a MC/SG cluster.
...but most admins love it :-)
To change it, all you need is to "vgexport" the VG,
create the "/dev/vg..." directory and the ".../group"
device, the latter with the *new* internal VG number.
Then you "vgimport" the VG, then "vgchange" it to be
active again, and be done.

Be careful to use *mapfiles* (option "-m") and option
"-s" on "vgexport" and "vgimport"!!!

HTH,
Wodisch
Byron Myers
Trusted Contributor

Re: Change of minor number for VG

My two cents worth - I have scripted pretty much what everyone is saying here. Whenever I change any LVM information on the primary SG node, I run the script on the standby. The script collects LVM info from the primary including minor numbers and makes every VG/LV look the same on the standby. This assures that the standby always looks like the primary.
If you can focus your eyes far and straight enough ahead of yourself, you can see the back of your head.
Frederic Bret
Occasional Advisor

Re: Change of minor number for VG

Hi,

In fact you absolutly need the same minor number if your LVs are implied in an NFS share : the exported filesystem has its minor number encoded in network NFS packets. If the minor number differ from one NFS server to another, you won't be able to achieve a true high availability when the package will switch.

Fred