Operating System - HP-UX
1834704 Members
2482 Online
110069 Solutions
New Discussion

Creating new VG need HEX help

 
SOLVED
Go to solution
Jeremy Loukinas_1
Occasional Advisor

Creating new VG need HEX help

I am creating some new vg's.

I know the command goes something like this..

mkdir /dev/vgxx
mknod /dev/vgxx/groupc c 64 0xNN0000
then a vgcreate..
How do I figure out the minor number for the group in hex?

Jeremy
Sunadmin@jslracing.com
Unix good...windows baddd..
7 REPLIES 7
Pete Randall
Outstanding Contributor
Solution

Re: Creating new VG need HEX help

Jeremy,

Typically the minor number matches the vg number. For example vg02 would be /dev/vg02/group c 64 0x020000

You can however use any legitimate hex number as long as it's unique.

Pete

Pete
Christopher McCray_1
Honored Contributor

Re: Creating new VG need HEX help

Unless you have to consider shared vgs in Serviceguard, then I would do:

# ll /dev/*/group

To list the the group files and start where the las one left off, so if the last one was, for example, 0x090000, then your next ones would be 0x0a0000, 0x0b0000, 0x0c0000, 0x0d0000 ..., 0x0f0000, 0x100000, and so on.

Hope this helps

Chris
It wasn't me!!!!
Tom Danzig
Honored Contributor

Re: Creating new VG need HEX help

The group minor number need only be unique to the system. To find out what numbers are in use:

find /dev -name group -exec ls -l {} \;

I typically use the same as the VG number (if it is in fact a number). Otherwise, I pick the next one up.
Sridhar Bhaskarla
Honored Contributor

Re: Creating new VG need HEX help

Hi,

You don't need to figure out the minor number. Make it unique and it should be less than the kernel parameter maxvgs.

To see if your minor number is unique, do

ll /dev/*/group

Note down the minor numbers of all the group files you found and pick a new minor number. Since only two fields are used you cannot go beyond "ff" which is 255 and that is the limit of max. no. of volume groups you can have on the system. However, the actual limit on your system is dependent on the kernel parameter maxvgs.

kmtune -l -q maxvgs

As said by Pete, good practice is to match vgyy with the minor number 0xyy0000

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

Re: Creating new VG need HEX help

Sometimes trying to find the next hex number that can be used is confusing. Here is a script that will do the job.

# ------------------ Decimal to Hex Converter

while [ $# -ge 1 ]
do
INPUT=$1
shift
echo "obase=16;ibase=10;${INPUT};quit" | bc
done
# --------------------------------------------
e.g.
# dec_hex.sh 12
C
Anyone for a Mutiny ?
Paul Sperry
Honored Contributor

Re: Creating new VG need HEX help

0xNN0000 can be anything as long as it is unique
Dave Wherry
Esteemed Contributor

Re: Creating new VG need HEX help

A practice I've used, which honestly has only come in handy a few times, is to set up groups of volume group numbers.
For example, on all of my systems vg00 is the operating system. On my production system all of my Oracle and SAP executables go in vg10. Then for the Oracle database I began with vg11, then vg12 and so on, adding them as I needed them.
On my QA system the executables are in vg20 with the database beginning in vg21 and so on.
My Development system uses vg30 and then vg31 and so on.
Other applications like OmniBack and Network Node Manager have their own unique volume group number.
The reason I do this is for portability between systems. Most of this is on an XP256 array. If I want to, or need to move an application to another host, either temporarily or for good, it's just easier if they already have a unique volume group number.
It doesn't happen often. I've used this approach when working on upgrades or some major tests. It also helps in a disaster recovery situation. I can bring my production environment up on my QA system in a matter of minutes without disturbing the QA enveironment.
Maybe a little over the top but, is has helped.