1752806 Members
6237 Online
108789 Solutions
New Discussion юеВ

Re: meaning of mknod

 
joseph51
Regular Advisor

meaning of mknod

mknod /dev/vg01/group c 64 0x010000

what is the meaning of this command..in my knowledge it is to create device file...but..here why we are using it as a character device file...what is the significant of this 64..why we are using four zeros after 01..

please give me an answer
8 REPLIES 8
Michal Kapalka (mikap)
Honored Contributor

Re: meaning of mknod

hi,

check lsdev = device driver = number 64 is LV/LVM

four zeros after 01 is normal counting of
devices.


mikap



Ganesan R
Honored Contributor

Re: meaning of mknod

Hi Binu,

mknod is the command to create special device files.

64 is the major number which is nothing but kernel driver number for lvm. #lsdev will list the available kernel drivers.

0x010000 -> is the minor which represents VG number in hex. But normally minor numbers represents hardware path, device specific parameters. Since LVM devices does not have these values it is represented with 4 zeros.
Best wishes,

Ganesh.
Ganesan R
Honored Contributor

Re: meaning of mknod

Hi,

Check this thread as well..

http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1031631
Best wishes,

Ganesh.
Sajjad Sahir
Honored Contributor

Re: meaning of mknod

Dear Binu

Each device file has one major number it is points to the kernel for example major number of volume group is 64
major number of all device file belongs to same category should be same but minor number is different meaing of the minor number groups all the logical volumes within a volume group. The 1st two digits in the minor number identify the volume group and the last two the logical volume within the volume group.
minor number should be unique in a system

thanks and regards

sajjad
avizen9
Esteemed Contributor

Re: meaning of mknod

Hello Sajid,

any idea,

how we can check which vg is occupied which major and minor number? so when we will create new vg we should not use that number. "However system itself will not allow to do so" thanks,
Ganesan R
Honored Contributor

Re: meaning of mknod

Hi Avizen9,

>>how we can check which vg is occupied which major and minor number? <<

Major number for all the VG is 64 only. Every VG should have only group file.To know the minor number give this command.

#ll /dev/*/group --> It will list the available
Best wishes,

Ganesh.
Sajjad Sahir
Honored Contributor

Re: meaning of mknod



hello Avizen

Dear Avizen

please see Ganeshan posting also

ls -l /dev/*/group

it will display the minor number

u can use next minor or minor number not already available in system

ok

thanks and regards

Sajjad Sahir
Taifur
Respected Contributor

Re: meaning of mknod

Hi Binu,
mknod /dev/vg01/group c 64 0x010000
/sbin/mknod name c major minor

Character device special files are used for devices that can transfer single bytes at a time, such as nine-track magnetic tape drives, printers, plotters, disk drives operating in "raw" mode, and terminals. To create a character special file, use the c argument.
Block device special files are used for devices that usually transfer a block of data at a time, such as disk drives. To create a block device special file, use the b argument.
The remaining arguments specify the device that will be accessible through the new special file:
major
The major number specifies the major device type (for example, the device driver number).
minor
The minor number specifies the device location, which is typically, but not always, the unit, drive, and/or line number.

The major and minor values can each be specified in hexadecimal, octal, or decimal, using C language conventions (decimal: no leading zero; octal: leading zero; hexadecimal: leading 0x).

The assignment of major and minor device numbers is specific to each HP-UX system. Refer to the System Administrator manuals supplied with your system for details.

http://docs.hp.com/en/B2355-90691/mknod.1M.html

If it helps, pls assign point
Rgds//
Taifur