LVM and VxVM

how can get major and minor number

 
SOLVED
Go to solution
Abubakkar
Frequent Contributor

how can get major and minor number

hi,
I want to create mknode /dev/vg01/group c, for that how can i get the major and mior number.
3 REPLIES 3
P Arumugavel
Respected Contributor
Solution

Re: how can get major and minor number

hi Abu,

Pls make a correction in command that is not mknode, is mknod.
For an example,
# mknod /dev/vg01/group c 64 0x010000

"C" denotes group file is a character device file. The major number is always 64 for LVM.

Where â hhâ represents the hexadecimal representation of the volume group number. Minor number will be unique for each volume group. It starts with 0x010000 (for first volume group) and goes on 0x020000, 0x030000 for succeeding volume groups. E.g. 0x020000 for vg02, 0x030000 for vg03 etc.

You will find the used minor numbers for current available volume groups from below directory:
#ll /dev/*/group

Regds \ vel
Bijeesh
Respected Contributor

Re: how can get major and minor number

Hi,

For Version 2.x volume groups,(with hpux 11.31) the major number for LVM device files is 128.
Viktor Balogh
Honored Contributor

Re: how can get major and minor number

Hi,

As others wrote it, you should choose either 64 or 128 for the major number, this tells the system that it will be a device file related to LVM.

As for a minor number, you should choose a unique hex number between 00 and ff. To list the existing minor numbers, run:

# ll /dev/vg*/group | awk '{print $6}' | sort -n
0x000000
0x010000
0x020000
0x030000
0x050000
#

So, choose a minor number which isn't already used on the system. And a note: if you are using the machine as a serviceguard node and you want to configure the volumegroup as a switchable volume, use the same minor on both systems. This means, the chosen minor must be free on both systems.

And finally, here comes the mknod command:

# mknod /dev/vgnew/group c 64 0x${MINOR}

where ${MINOR} is the free, system-wide unique minor number. (00-->FF)

Regards,
Viktor
****
Unix operates with beer.