The kernel call that makes device files is called mknod(2).
There is a command, mknod(1) to set up a device file from
the command line. To re-create a device, you need to know the
major and minor device numbers. For /dev/tty0 these are
major device 4, minor device 0.
crw--w--w- 1 root root 4, 0 Aug 16 13:24 /dev/tty0
So, the command to re-create the device (run it as root) is:
mknod /dev/tty0 c 4 0
MAKEDEV automatically makes all devices in the system based on
data about the current kernel (I've never looked for where it gets
it from). MAKEDEV is available in Debian and Red Hat, I don't
know about other distros. The "mknod" command above should
work for any 2.0.x or 2.2.x kernel AFAIK. You might want to
just run the mknod command if /dev/tty0 is the only one messed
up.
> > Then, as the startup progresses you can not startx or kde ...
> > because fsck has deleted the device /dev/tty0.
> >
> > Is there a way to reinstall this device without having to
> > reinstall the whole distribution.
>
> I'm not sure about your distribution, but in RedHat, there's a script in /dev
> called MAKEDEV. This can be used to create the device entries. For usage, try
> man MAKEDEV. Observe the capitol letters. They are important !
>