I can`t create a device node in /dev
I have just changed from Slackware 9.1 to 10.0 with kernel 2.6.7 in order to install it on a SATA hard disk. Almost everything is O.K. but some old packages (penggy) needs a device node named "tun" in a subdirectory named "net" under /dev. I created both, as root of course, using
/dev# mkdir /net /dev# mknod /dev/net/tun c 10 200 and also I need a symlink to /dev/ttyS0 named "modem" /dev# ln -s /dev/ttyS0 modem I do this things succesfully but when I shut down my computer and turn it on again.....the subdirectory, the device node and the symlink just have gone!!! So every time I start my computer I need to do such task :mad: Does anyone know how to fix this? Is this behavior due to any new kernel feature? Thank you very much in advance |
Perhaps it has something to do with udev! What is the output of this command when your systen is up,
df y2k |
I'm having same prob with Mandrake 10.1 and penggy. Says:
"unable to open /dev/net/tun" then some more crud about trying 2.2 kernel method before: "Fatal error, exiting." So I'm guessing if the 2.4 and 2.2 methods don't work there must be a new 2.6 method? :( |
Hi, as Y2K said it is related to udev/hotplug.
"udev" is the new method used by 2.6 kernel series to manage device nodes within the system. Basically udev creates device nodes only for the hardware that is actually present into the system. Any device node you create manually on the current session will not be re-created on the further boot automatically, you must specify your requirements through "udev" configuration files and scripts. "udev" is not that hard to be properly managed, but at least it requires you read some basics of the method. The udev basics can be found on /usr/doc/udev-026/docs/writing_udev_rules. While you get more confident with them you can create the nodes you need (persistently) editing your /etc/rc.d/rc.local as follows: if [ `uname -r` = "2.6.7" ]; then # This avoid the node is created using different kernels (ie 2.4.26). /bin/mkdir /dev/net /bin/mknod /dev/net/tun c 10 200 fi Hope this helps Ciao |
Thank you very much for the advises.
I start to read the document related to udev and follow the urka58's suggestion about make an entry on rc.local to create the directory, the node and the symlink. I did that but in a special file that exists for the purpose /etc/udev/scripts/make_extra_nodes.sh which is invoked from /etc/rc.d/rc.udev this is what I add at the bottm of the first file # Device and Symlink needed for Penggy if [ ! -r /dev/net/tun ]; then mkdir /dev/net mknod -m 666 -c /dev/net/tun 10 200 fi if [ ! -r /dev/modem ]; then ln -s /dev/ttyS0 /dev/modem fi Now penggy is alive :D and I don't need to connect to Internet trough :tisk: Windows :tisk: Again Thank you very much. |
First, Linux newb here. Have decided to go "cold turkey" by dumping M$ Windoze.
Thanks to urka58 and gcasados I was able to understand why penggy was "torn down" after my pc was restarted. I have attempted to use both examples but cannot get the node to rebuild automatically. There has to be something I'm overlooking. Although I can create the node manually, having it done during boot-up would be a plus. Any assistance would be greatly appreciated. yelnats |
Hi yelnats,
I'd suggest you start a new thread, you'll have more possibily someboby responds you. Anyway, if you are able to create the node manually and your software works, it must be possible a script do it for youa t boot. Can you give more details what did you tried up to now? Ciao |
Hi urka58, thanks for the reply. I thought about making a new thread but did not want to a typical noob thing and make someone mad. Anyway, I copied the script in your reply to gcasados. My rc.local file contains this:
if [ uname -r = "2.6.8" ]; then /bin/mkdir /dev/net /bin/mknod -m 666 -c /dev/net/tun c 10 200 fi I added those lines to the file as su, made the changes, saved the file and exited terminal. No joy, it still does not rebuild automatically. I then tried gcasados' scripts and no joy there either. Like I said, I can enter it manually and penggy works great every time, just would be nice for it to happen when I restart the pc. Even so, I still need to do more reading (and understanding) on writing udev rules. Thanks again. Regards, yelnats |
Hi yelnats,
may be you just wrote it wrong, but there are a couple of backquotes missing in your script. In order you get 2.6.8 (possibly) you should edit as follows: if [ `uname -r` = "2.6.8" ]; then ----------------> note the backquotas /bin/mkdir /dev/net /bin/mknod /dev/net/tun c 10 200 fi I don' t know if necessary, but the link to /dev/modem is missing as well. I wouldn't care for the moment to give the correct permissions to the node, but if you want the command is chmod 666 /dev/net/tun Hope this helps Ciao |
All times are GMT -5. The time now is 08:35 AM. |