[wellylug] Damn small Linux
David Antliff
david.antliff at gmail.com
Thu Jun 22 11:35:19 NZST 2006
On Thu, 22 Jun 2006, E.Chalaron wrote:
> Now the question is : what values to use for major and minor ??? cant find
> anything explicit e.g. mknod for dummies, not man mknod !!
Assuming it's a straightforward IDE cdrom drive (using idecd driver):
$ cat /proc/devices | grep ide
3 ide0
22 ide1
So, if you think it should be 'hda' or 'hdb', then major number is 3,
'hdc' and 'hdd' use 22. hdc and hdd are on your second IDE channel, i.e.
the second cable to your motherboard.
The minor number for each disk is 6 bits, in the range 0-63, where 0 is
the block device of the first disk, and 1-63 are the partition numbers,
and 64 is the block device of the second disk on this channel, and it has
partition numbers 65-127
So:
/dev/hda:
# mknod /dev/hda b 3 0
/dev/hdb:
# mknod /dev/hda b 3 64
/dev/hdc:
# mknod /dev/hdc b 22 0
/dev/hdd:
# mknod /dev/hdd b 22 64
And the partitions continue from there, incrementing the minor number for
each one. So, /dev/hdd3 would be major 22, minor 67.
Now, if you're using SCSI-IDE emulation or a SCSI drive, it would be
different.
Does damnsmall not use devfs? The kernel is too old for udev, but devfs
would sort this out for you if you have the kernel driver loaded.
Hope this helps,
--
David.
More information about the wellylug
mailing list