Operating System - HP-UX
1834093 Members
2333 Online
110063 Solutions
New Discussion

Limitation with no of VGs

 
SOLVED
Go to solution
amit mehta_2
Regular Advisor

Limitation with no of VGs

Hi,

while creating VGs,we need to give an unique ID, i.e.
$ vgcreate -s 4 /dev/vgtest/group c 64 0x040000
Is it true that minor no(0x040000) has to be between 00 - FF (here i have given "04").
If it is true then this mean that at one point one can't have more than 255 different VGs.
why there is such restriction?

Thanks,
Amit
14 REPLIES 14
James R. Ferguson
Acclaimed Contributor
Solution

Re: Limitation with no of VGs

Hi Amit:

The number of volume groups is limited to the range 00-FF, giving 255 (decimal) volume groups maximum.

The kernel parameter 'maxvgs' controls the maximum and each increment in the volume group number consumes about 4-8KB of kernel memory. By default, only 10 (decimal) volume groups are allowed (0-9).

As you can deduce, the kernel keeps information about active volume groups in a table and it is this table that has an upper bound stated by 'maxvgs'.

Given that any one volume group can (if initially, properly configured) have up to 255 *physical* volumes, this limitation is hardly a limitation at all.

Regards!

...JRF...
Patrick Wallek
Honored Contributor

Re: Limitation with no of VGs

You are correct. You cannot have more than 255 VGs.

A limit you may not know about is the MAXVGS kernel parameter, which is set at 10 by default I believe.

Without resetting that parameter, you cannot have more VGs than the number that parameter is set at.

>>Why is there such a restriction?

Good question. You'd have to ask the HP-UX developers.

My question to you would be -- Why do you need more than 255 VGs? Could you not combine some of the VGs so that there are multiple LVs in a VG, thus reducing your required number of VGs?
Pete Randall
Outstanding Contributor

Re: Limitation with no of VGs

256, actually, see MAXVGS kernel parameter. I'm sure this was an arbitrary number chosen by HP kernel developers who probably thought that it was more important to make a large number of logical volumes available than a large number of volume groups. I find it hard to imagine a need for more than 10 to 20 VGs, myself.


Pete

Pete
amit mehta_2
Regular Advisor

Re: Limitation with no of VGs

Hi,

Thanks a lot.I asked it for the sake of curiosity. A follow up question on this is that is there any way by which i can determine which minor nos have been already used?

Thanks,
Amit
Patrick Wallek
Honored Contributor

Re: Limitation with no of VGs

Do a:

# ll /dev/vg*/group

This will list all the group files and you can have a look at the minor numbers. This also assumes all your VGs are named starting with the characters 'vg'.



Patrick Wallek
Honored Contributor

Re: Limitation with no of VGs

Just looking at the commands you gave in your initial post. You actually create the minor number BEFORE you do a vgcreate.

The minor number is created with the mknod command when you create the group file.

# mkdir /dev/vgtest
# mknod /dev/vgtest/group c 64 0x040000
# vgcreate vgtest
James R. Ferguson
Acclaimed Contributor

Re: Limitation with no of VGs

Hi (again) Amit:

> Is there any way by which i can determine which minor nos have been already used?

Yes. Simply do:

# ls -l /dev/*/group

...and examine the ordered output. For '/dev/vgtest/group' as you show in this post, the minor number is four (in hexadecimal, 0x04). A volume group number of 255 (decimal) would be 0xff.

Regards!

...JRF...
Gary L. Paveza, Jr.
Trusted Contributor

Re: Limitation with no of VGs

Just to clarify, MAXVGS is not only the maximum number of volume groups, it's also the maximum value you can have for the minor number of the volume group. So, if you have it set to 10, you can only use to up to 10. You cannot use, for example, 0x200000.
Pete Randall
Outstanding Contributor

Re: Limitation with no of VGs

Just a guess:

Is the limitation of 256 because of the minor number being limited to two hex digits?


Pete

Pete
Patrick Wallek
Honored Contributor

Re: Limitation with no of VGs

Pete - In a nutshell, yes.

Unless the minor number is reworked, which would probably be royal pain in the a**, I don't see any way to allow more VGs.

The hex range of 00 thru FF is all that you have available.
James R. Ferguson
Acclaimed Contributor

Re: Limitation with no of VGs

Hi:

You only have two digits for a minor number of a device (see 'mknod()'). This number is packed into hexadecimal so you have 256 possible volume group numbers, ranging from 00-255 or 0x00-0xff in hexadecimal!!!

Regards!

...JRF...
Denver Osborn
Honored Contributor

Re: Limitation with no of VGs

the 1st 2 hex are for the VG, and the last 2 hex are for the LV number... Are the 3rd and 4th fields used for anything? any chance we could see > 255 lvols or 256 volumes w/ lvm?

-denver
Patrick Wallek
Honored Contributor

Re: Limitation with no of VGs

You must remember that the 0x?????? minor numbers are not used with just LVM.

If you have a look in the /dev/rmt directory you will notice that the minor number for your tape drives uses all 6 characters of the minor number. These are what control density, berkely/at&t behavior, rewind/no-rewind, etc.

The minor numbers are used in conjunction with the major number to determine the behavior of the device.

So, my guess is, that without a major rework of how device files as a whole are handled, and a redo of the major & minor number combinations, you will not see the possibility of more than a 00-FF range for the VG-id in the /dev/vg*/group file minor number.
amit mehta_2
Regular Advisor

Re: Limitation with no of VGs

Thanks to all of you