LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-25-2004, 08:27 PM   #1
gcasados
LQ Newbie
 
Registered: Dec 2004
Location: Mexico City
Distribution: Slackware
Posts: 2

Rep: Reputation: 0
Question 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

Does anyone know how to fix this?
Is this behavior due to any new kernel feature?

Thank you very much in advance
 
Old 12-25-2004, 08:35 PM   #2
y2k
Member
 
Registered: May 2004
Location: Somewhere over there!!!
Distribution: Too many to list here...
Posts: 93

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

df

y2k
 
Old 12-26-2004, 07:40 AM   #3
Crito
Senior Member
 
Registered: Nov 2003
Location: Knoxville, TN
Distribution: Kubuntu 9.04
Posts: 1,168

Rep: Reputation: 53
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?


Last edited by Crito; 12-26-2004 at 07:43 AM.
 
Old 12-26-2004, 08:38 AM   #4
urka58
Member
 
Registered: Nov 2003
Distribution: slackware 15
Posts: 546

Rep: Reputation: 43
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

Last edited by urka58; 12-26-2004 at 08:40 AM.
 
Old 12-26-2004, 02:26 PM   #5
gcasados
LQ Newbie
 
Registered: Dec 2004
Location: Mexico City
Distribution: Slackware
Posts: 2

Original Poster
Rep: Reputation: 0
Talking

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

and I don't need to connect to Internet trough Windows

Again Thank you very much.
 
Old 02-20-2005, 08:56 AM   #6
yelnats
LQ Newbie
 
Registered: Feb 2005
Distribution: Mandrake 10.1
Posts: 3

Rep: Reputation: 0
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
 
Old 02-20-2005, 04:42 PM   #7
urka58
Member
 
Registered: Nov 2003
Distribution: slackware 15
Posts: 546

Rep: Reputation: 43
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
 
Old 02-20-2005, 05:15 PM   #8
yelnats
LQ Newbie
 
Registered: Feb 2005
Distribution: Mandrake 10.1
Posts: 3

Rep: Reputation: 0
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
 
Old 02-21-2005, 05:17 AM   #9
urka58
Member
 
Registered: Nov 2003
Distribution: slackware 15
Posts: 546

Rep: Reputation: 43
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ieee1394: /dev/raw1394 device node missing kevinatkins Linux - Hardware 4 12-16-2008 11:07 AM
USB CDRW: sg won't create sg* device in /dev sugapablo Linux - Hardware 3 05-06-2005 08:07 PM
udev does not create scsi device node maenho Linux - Software 0 11-27-2004 05:08 AM
how to create device node for dynamically allocated major number appas Programming 5 11-01-2004 09:37 AM
"unable to find device node for /dev/x in /dev!" during install zombiedeth *BSD 0 02-02-2004 02:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration