On Sat, 2 Feb 2002, Kevin Fonner wrote:
> I am currently creating my own boot disk from scratch, sort of a
> way to learn all the nitty gritty details of linux. In the bootdisk
> how-to they mention using mknod to create the files for the devices.
> I can't seem to find any good information about how to create the actual
> device files. Anybody know any good how-to that contains this information
> or other sorces.
The mknod syntax is very simple:
mknod [OPTION]... NAME TYPE [MAJOR MINOR]
To get a list of the options, take a look at the devices.txt file in
the kernel documentation.
For example, it lists the following device:
9 char SCSI tape devices
0 = /dev/st0 First SCSI tape, mode 0
1 = /dev/st1 Second SCSI tape, mode 0
If I do an 'ls -l /dev/st0' you'll see the following:
crw-rw---- 1 root disk 9, 0 Apr 14 2001 /dev/st0
This shows that the /dev/st0 is a character device with major number of
9 and minor number of 0. It has 660 permissions. To create this device
with mknod I would type:
mknod -m 660 st0 c 9 0
Now that you know that, take a look at the MAKEDEV utility which allows
you to create the device just by knowing the name.
Want to buy your Pack or Services from MandrakeSoft?
Go to http://www.mandrakestore.com