Read on for more information.
Why would you need these values?
Loading the driver for a particular device is half the battle, the other half is having a "device node" which has correct values which will allow you to access that device. So a device driver without a correct device node doesn't do much good.
Let's say you need to gain access to your Linux filesystem to make some repairs; however it's not booting, nor do you have a boot disk. Never fear, just boot up on the Linux installation media you have, load the driver like you did originally. Now switch over to the bash screen, create the necessary device nodes, and proceed to mount your Linux filesystems and make the necessary repairs to make it bootable again.
What do I do with a device node?
A device node consists of a name, a type (block, character, etc), and a major and minor number. Remember, you need to go through the device node in order to gain access to the particular device once you have the device driver loaded.
Device Node Name:
The name really doesn't matter; however, it's always best to use the correct name to prevent any confusion.
Device Node Type:
The type depends on the device you are using. Block devices are generally hard drives, cdrom's, etc. Character devices are generally terminal screens, tape drives, etc.
Device Node Major Number:
The major number basically represents which driver to call. The major and minor numbers can be compared to a standard computer Interrupt. Basically when you call on a particular major number, you get a response from the correct driver.
Device Node Minor Number:
The minor number represents which device you want in particular when speaking to a particular driver. For example when working with a SCSI bus, the minor number would determine which drive you wanted on the SCSI bus.
Here is an exampl of an entry from the /dev directory:
brw-rw---- 1 root disk 8, 0 May 5 1998 sda
This is for the first SCSI hard drive. "sd" stands for SCSI DISK, "a" represents the first SCSI disk - again, the name really doesn't determine anything. The "b" at the very beginning of the line states that this is a block device. The 8, 0 represents major number 8, and minor number 0. Major number 8 is the SCSI driver, minor number 0 represents the first SCSI device on the SCSI channel.
How do you create a device node?
If you know the type, major, and minor numbers, then you can create a device node. Lets say we want to create a device node for the Compaq array controller. That would be of type "block", it would have a major number of 72. If I wanted to specify the whole drive so that I can run fdisk on it, I would need the first entry which is the minor number 0. the name for this would be c0d0 which stands for controller 0 drive 0. Lets create this specific device node:
mknod /test/c0d0 b 72 0
This node is now referenced by calling upon /test/c0d0. If we wanted to get a partition listing on this from fdisk, we would type the following:
fdisk -l /test/c0d0
If I wanted access to any of the other partitions if I wanted to mount them or check them, I would need the other device nodes for those particular partitions I want access to. If the work you are putting forth is temporary (i.e. in a ramdisk), then you only need to create the specific device nodes for the specific partitions you need access to. If your results are going to be permanent then you should create device nodes for all the partitions.
The following is an example of creating device nodes for the 1st 2nd and 15th partitions for the Compaq array controller:
mknod /test/c0d0p1 b 72 1
mknod /test/c0d0p2 b 72 2
mknod /test/c0d0p15 b 72 15
Here is a script that will create device nodes for the Compaq Smart Array controller:
Last updated 03-23-2000 dev.html - Added a complete /dev, /dev/rd, /dev/ida listing for usage with the recovery document. Document created and released on http://www.cpqlinux.com.