LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   I can`t create a device node in /dev (https://www.linuxquestions.org/questions/slackware-14/i-can%60t-create-a-device-node-in-dev-270332/)

gcasados 12-25-2004 08:27 PM

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

y2k 12-25-2004 08:35 PM

Perhaps it has something to do with udev! What is the output of this command when your systen is up,

df

y2k

Crito 12-26-2004 07:40 AM

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? :(


urka58 12-26-2004 08:38 AM

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

gcasados 12-26-2004 02:26 PM

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.

yelnats 02-20-2005 08:56 AM

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

urka58 02-20-2005 04:42 PM

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

yelnats 02-20-2005 05:15 PM

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

urka58 02-21-2005 05:17 AM

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.