System Administration
Showing results for 
Search instead for 
Did you mean: 

Major and minor number for a vg

Go to solution
Waqar Razi
Regular Advisor

Major and minor number for a vg

How can I check the major and minor number for a volume group in Red Hat Linux?

I really appreciate any help in this regard.
Honored Contributor

Re: Major and minor number for a vg

Are you perhaps assuming Linux is like HP-UX and requires consistent VG device numbers in clusters?

Linux (kernel 2.6.*) does not work that way.
There is no device for the VG (like /dev/vgNAME/group in HP-UX), only for its LVs.

The LV major and minor numbers are allocated dynamically by the device-mapper _at the time the VG is activated_. If you activate a few VGs, reboot the machine and then activate the same VGs again in a different order, the LV minor numbers will not be the same as before. Therefore, *a Linux application must never rely on the LV major/minor numbers in any way*.

But if you're curious, you can see the numbers by running a command like "ls -l /dev/mapper/vgNAME-*". The major and minor numbers are listed in the column normally occupied by the file size. (A device node does not have a "size" as such, even if the device behind it has a measurable size.)

If you are familiar with ServiceGuard on HP-UX and now working with ServiceGuard on Linux, be careful: you may assume too much. There are several important differences.

Some other things that might surprise you:

* No need to export the VGs and move map files around to make the VGs known to all nodes of the cluster: just run "vgscan" in all nodes and you're done.

* If you use RHEL 4 or 5, the distribution is equipped with dynamically managed /dev filesystem, "udev". The LV devices will appear automatically _when the VG is activated_, not before. They will also be deleted automatically when you deactivate a VG. This can cause much confusion if you don't expect it.

Uday Joshi_1
Occasional Visitor

Re: Major and minor number for a vg

ll /dev/*/group

For Ex:

crw------- 1 root sys 64 0x190000 Nov 16 2008 /dev/vg19/group

In this case major no. is 64 & minor no is Hexadecimal no. 0x190000