Operating System - HP-UX
1832910 Members
2940 Online
110048 Solutions
New Discussion

Available minor numbers/VG

 
SOLVED
Go to solution
Jamesbond313
Occasional Contributor

Available minor numbers/VG


When creating a device file named group in the volume directory with the mknod command, what command do I use to obtain and display available minor numbers

Mknod /dev/vgname/group c major 0xminor


Thanks in advance for the assistance
18 REPLIES 18
vishnu.khandare
Respected Contributor

Re: Available minor numbers/VG

Hi James,

please use below command
#mknod /dev/vg0X/group c 64 0x0X0000
In Place of X change the no as per ur volume group for example vg01 as below

#mknod /dev/vg01/group c 64 0x010000


Hope this solves ur qery
Don't forget to assign points.

Regards
Vishnu Khandare
You should deserve before U desire!!!!
James R. Ferguson
Acclaimed Contributor

Re: Available minor numbers/VG

Hi:

# ls -l /dev/vg*

If you are running a release less than 11.31 you will need to verify your kernel's 'maxvgs' value. Since vg00 counts as a used slot, a 'maxvgs' value of 10 means that you could have 'vg00..vg09' assuming you name your volume groups to match their minor number.

Regards!

...JRF...
Pete Randall
Outstanding Contributor

Re: Available minor numbers/VG

How about "ll /dev/vg*/group"? The output looks like this:

# ll /dev/vg*/group
crw-r----- 1 root sys 64 0x000000 Mar 15 2004 /dev/vg00/group
cr--r--r-- 1 root sys 64 0x010000 Mar 30 2004 /dev/vg01/group
crw-rw-r-- 1 informix informix 64 0x030000 Nov 26 2009 /dev/vg03/group

The minor numbers are the first two digits after "0x".


Pete

Pete
Pete Randall
Outstanding Contributor
Solution

Re: Available minor numbers/VG

How about "ll /dev/vg*/group"? The output looks like this:

# ll /dev/vg*/group
crw-r----- 1 root sys 64 0x000000 Mar 15 2004 /dev/vg00/group
cr--r--r-- 1 root sys 64 0x010000 Mar 30 2004 /dev/vg01/group
crw-rw-r-- 1 informix informix 64 0x030000 Nov 26 2009 /dev/vg03/group

The minor numbers are the first two digits after "0x".


Pete

Pete
Pete Randall
Outstanding Contributor

Re: Available minor numbers/VG

Apologies for the duplication. I forgot to check the retain spacing button.


Pete

Pete
Fraga
Advisor

Re: Available minor numbers/VG

Hi,

It's simples:
/> ll /dev/*/group
crw-r----- 1 root sys 64 0x000000 Oct 30 2008 /dev/vg00/group

minor = 0x000000
major = 0x000000

Regards
EFS
Fraga
Advisor

Re: Available minor numbers/VG

Correction:
major = 0x
minor = 64
Fraga
Advisor

Re: Available minor numbers/VG

Sorry, my posts were confusing, this inverted ...............
I will go for here.
Tim Nelson
Honored Contributor

Re: Available minor numbers/VG

and to give you more information than ever needed for a simple "ls -ld /dev/vg*/group" command.

the maximum number of volume groups is equal to the kernel parameter MAXVGS in 11.11 and 11.23, i believe the limit is 255 in 11.31

cheers
Pete Randall
Outstanding Contributor

Re: Available minor numbers/VG

Fraga,

Still confusing. The major number is 64, which can be traced back to lsdev output to tell that this is an lvm device. The minor number is the first two digits following the 0x designation, in your example it would be 00, which most like indicates vg00.


Pete

Pete
VK2COT
Honored Contributor

Re: Available minor numbers/VG

Hello,

a) The LVM volume groups do not have to
have names starting with "vg", so
this is more appropriate:

# ll /dev/*/group

b) On HP-UX 11.31, if you use VG versions
2.x, you do not need all that nonsence
about mknod(1M). For example:

# vgcreate -V 2.2 ...

It automatically creates the volume group and picks up a free minor number. Absolutely
no need to run command mknod(1M) manually.

c) Finally, on HP-UX 11.31, VG versions 2.x
have major number 128. Only VG version 1.0
(traditionally being in use for the last
27-odd years), has major number 64.

In short, if you use latest HP-UX 11.31,
I would not even try to use VG version 1.0.

Cheers,

VK2COT
VK2COT - Dusan Baljevic
Bill Hassell
Honored Contributor

Re: Available minor numbers/VG

The only requirement is that each VG has a unique 2 digit hex number after the 0x. Although highly likely, 0x00 is probably vg00, but any hex value from 0x00 through 0xff will work as long as it is unique. To find what has already been used:

ll /dev/*/group | awk '{print $6,$NF}'

Now not all of these group files may be in use. The VG may be deactivated or it may have just been created with mkdir and mknod but never used in a VG.


Bill Hassell, sysadmin
Bill Costigan
Honored Contributor

Re: Available minor numbers/VG

One other thing.

The minor number is in hex.

So the number that would follow 0x090000 would be 0x0a0000. 0x100000 would follow 0x0f0000.

There doesn't have to be any relationship between the vg name and the minor number but each VG must have a unique minor number.

It is common for vg01 to have 0x010000 and vg02 to have 0x020000, etc. but it is not necessary.
Chandrahasa s
Valued Contributor

Re: Available minor numbers/VG

Hi,

ll /dev/vg*/group

If you have 11iv3 you no need to worry abour minor number you simply run vgcreate(no need to do mkdir vg and mknod)

chandra
Ismail Azad
Esteemed Contributor

Re: Available minor numbers/VG

Hi,

There is a convention that can be followed :-
/dev/vg05/lvol2
Minor number :- 0x050002
First 2 bits for volume group last 2 for logical volume (although very few people follow this as they give there own names for vgs and lvs). This is for LVM v1 . For v2 those 2 bits become 3 bits!. And hence in 11iv3 using LVM v2 we can have vgs and lvs upto fff which is more than 255 but only for LVM version2 and higher.

Regards
Read, read and read... Then read again until you read "between the lines".....
Torsten.
Acclaimed Contributor

Re: Available minor numbers/VG

And again - without telling your OS version you cannot get an exact answer ...

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
SoorajCleris
Honored Contributor

Re: Available minor numbers/VG

Hi,

addon,

If your maxvgs ( prior to 11iV3) parameter is 8 and you have used minor number -07- to create a group file ( 0x070000) , you will not be able to create anymore VG , even there is only two VGs existing in the system.

Vgcreate command will give you an error which you have never seen ..

enjoy it !!!

Regards,
Sooraj
"UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity" - Dennis Ritchie
SoorajCleris
Honored Contributor

Re: Available minor numbers/VG

If you liked it , assign the points!!!!
"UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity" - Dennis Ritchie