HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

Question about minor numbers

 
SOLVED
Go to solution
dictum9
Super Advisor

Question about minor numbers


What format are the minor numbers for the Volume Groups are? 0x030000 Looks like Hex?

ll /dev/*/group

I need to dynamically create some groups and thus the minor numbers.
14 REPLIES
Torsten.
Acclaimed Contributor
Solution

Re: Question about minor numbers

Hope I understand the question correctly ;-)

If you have

0x030000

the "03" is the number, followed by 04,05,...0a,0b up to the maximum configured number (max VG).

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!   
dictum9
Super Advisor

Re: Question about minor numbers

This is what I mean, how do I translate these into decimal?

crw-r--r-- 1 root root 64 0x020000 Nov 22 00:07 /dev/BCVvgp60arch/group
crw-r--r-- 1 root root 64 0x030000 Nov 22 00:07 /dev/BCVvgp60data/group
crw-r--r-- 1 root root 64 0x010000 Nov 22 00:07 /dev/BCVvgp60logs/group
crw-r----- 1 root sys 64 0x000000 Jul 7 2006 /dev/vg00/group
crw-r--r-- 1 root root 64 0x100000 Jul 29 2008 /dev/vgJPPArch/group
crw-r--r-- 1 root root 64 0x070000 Jul 30 2008 /dev/vgJPPData/group
crw-r--r-- 1 root root 64 0x060000 Jul 30 2008 /dev/vgJPPLogs/group
crw-r--r-- 1 root root 64 0x090000 Sep 17 2007 /dev/vgP60Arch/group
crw-r--r-- 1 root root 64 0x040000 Sep 17 2007 /dev/vgP60Data/group
crw-r--r-- 1 root root 64 0x080000 Sep 17 2007 /dev/vgP60Logs/group
crw-r--r-- 1 root root 64 0x050000 Apr 2 2008 /dev/vgP60Oracle/group



Michael Steele_2
Honored Contributor

Re: Question about minor numbers

Hi

"...how to translate into dec. ? "

Open windows calculator. Switch to scientific mode. Switch to hex mode. Copy and paste in number. Switch to dec. mode now for answer.
Support Fatherhood - Stop Family Law
James R. Ferguson
Acclaimed Contributor

Re: Question about minor numbers

Hi:

> how do I translate these into decimal?

There are a number of ways. Here's one:

# perl -le 'print hex $ARGV[0]' 10
16

Regards!

...JRF...
dictum9
Super Advisor

Re: Question about minor numbers

How do I increment the minor numbers?

Is it the first 2 digits of the number, 0xNN0000? Meaning that I can only have 99 minor numbers?

Tim Nelson
Honored Contributor

Re: Question about minor numbers

here is what I do, it may be lame but it got me what I wanted. modify at your pleasure.


for ii in \
0x010000\
0x020000\
0x030000\
0x040000\
0x050000\
0x060000\
0x070000\
0x080000\
0x090000\
0x0a0000\
0x0b0000\
0x0c0000\
0x0d0000\
0x0e0000\
0x0f0000\
0x100000\
0x110000\
0x120000\
0x130000\
0x140000\
0x150000\
0x160000\
0x170000\
0x180000\
0x190000\
0x1a0000\
0x1b0000\
0x1c0000\
0x1d0000\
0x1e0000\
0x1f0000
do
if ls -l /dev/vg*/group|awk '{print $6}'|grep $ii > /dev/null 2>&1
then
echo "$ii already used... Skipping $ii"
:
else
echo "Next minor is $ii "
break
fi
done
Michael Steele_2
Honored Contributor

Re: Question about minor numbers

Hi

Incrementing is either done automajically by the o/s each time a device is added, or, manually with 'mknod' command. Perhaps the most common example is in LVM whenever a new volume group is change. vg00 will have a major number of 64 and a minor number of 0x010000 and is created at time of installing the o/s. However, any other volume group now uses this very common procedure:

mkdir /dev/vg01
mknod /dev/vg01 c 64 0x020000

...were 0x##0000 are variables.

Support Fatherhood - Stop Family Law
Tim Nelson
Honored Contributor

Re: Question about minor numbers

BTW the number of minor numbers are directly related to your maxvgs setting in the kernel.

if maxvgs is set to 10 then the max hex number for the group file is "oxoa0000"

James R. Ferguson
Acclaimed Contributor

Re: Question about minor numbers

Hi (again):

> How do I increment the minor numbers?
Is it the first 2 digits of the number, 0xNN0000? Meaning that I can only have 99 minor numbers?

No, this is a _hexadecimal_ number and so each digit ranges from 0-F for overall values of 00-FF. That's 256 unique numbers.

Through release 11.23 (11iv2) you need to assign numbers that are less than the kernel parameter 'maxvgs'. If this tunable is set to (decimal) ten (10), then the largest value you can have for a volume group minor number is 0x09 since nine in hex is also nine in decimal and vg00's number of 0x00 counts as one volume group.

In 11.31 the 'maxvgs' tunable is obsolete and acts as if it were set to 256.

Regards!

...JRF...
dictum9
Super Advisor

Re: Question about minor numbers

Quote--------
No, this is a _hexadecimal_ number and so each digit ranges from 0-F for overall values of 00-FF. That's 256 unique numbers.
--------------------------


Thank you. that's what I was looking for.
Where can I can get this complete list of these 256 numbers?
James R. Ferguson
Acclaimed Contributor

Re: Question about minor numbers

Hi (again):

> Where can I can get this complete list of these 256 numbers?

Well, manufacture one if you want:

# perl -le 'for (0..255) {printf "%3d %2X\n",$_,$_}'

Regards!

...JRF...
Michael Steele_2
Honored Contributor

Re: Question about minor numbers

Hi

0
1
2
3
4
5
6
7
8
9
0
a
b
c
d
e

16** = 256
Support Fatherhood - Stop Family Law

Re: Question about minor numbers

>how do I translate these into decimal?

In a real shell you can do:
typeset -i10 x=16#ff; echo $x

>How do I increment the minor numbers?

typeset -i16 x=$(( 16#NN + 1 )); echo $x
dictum9
Super Advisor

Re: Question about minor numbers

Great, thank you.