Operating System - HP-UX
1753944 Members
8202 Online
108811 Solutions
New Discussion юеВ

Re: 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 14
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...