LinuxQuestions.org
Visit the LQ Articles and Editorials section
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 08-12-2006, 07:14 PM   #1
Yalla-One
Member
 
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 635

Rep: Reputation: 35
udev: /dev/ directory over-populated - why?


Just had a diskcrash and did a clean install of -current (Saturday) on a laptop.

For some reason, the /dev directory looks just like pre-udev days, with hda1,hda2,hda3 etc, hdb*, hdc*, hdd* and so on.

Why does udev fully populate my /dev directory?

And also, when I boot the system complains that root file system is of wrong format etc, but still mounts it well. Also complains about tmpfs and swap, even though top reports that swap is present (though never used)

My fstab:
Code:
/dev/hda2        swap             swap        defaults               0   0
/dev/hda1        /                reiserfs    defaults               1   1
/dev/hda3        /export          reiserfs    defaults               1   2
/dev/cdrom       /mnt/cdrom       auto        noauto,owner,users,ro  0   0
devpts           /dev/pts         devpts      gid=5,mode=620         0   0
proc             /proc            proc        defaults               0   0
scanner          /proc/bus/usb    usbfs       auto,devmode=0666     0   0
majestix:/files  /files           nfs         defaults              0   0
/dev/ipod30gb    /mnt/ipod30gb    vfat        noauto,owner,users    0   0
/dev/ipodnano    /mnt/ipodnano    vfat        noauto,owner,users    0   0
/dev/mem_red     /mnt/mem_red     vfat        noauto,owner,users    0   0
/dev/mem_big     /mnt/mem_big     vfat        noauto,owner,users    0   0
My /etc/udev/rules.d/10-local.rules is:
Code:
# Sony USB CD/DVD-RW
BUS="usb", KERNEL="sr[0-9]*", SYSFS{manufacturer}="Sony", SYSFS{serial}="DRX-510
ULK_CED011664", NAME="%k", GROUP="cdrom", MODE="0666", SYMLINK="dvd cdrom"

# Canon USB Scanner
BUS="usb", SYSFS{product}="CanoScan", MODE="0666", SYMLINK="scanner"

# iPod 30GB and iPod Nano
BUS="usb", SYSFS{product}=="iPod", SYSFS{serial}=="000A270014DA3027", KERNEL="sd
?2", NAME="%k", SYMLINK="ipod30gb", MODE="0666"
BUS="usb", SYSFS{product}=="iPod", SYSFS{serial}=="000A2700129F41E7", KERNEL="sd
?2", NAME="%k", SYMLINK="ipodnano", MODE="0666"

# Memory Stick(s)
KERNEL="sd*", SYSFS{idVendor}=="0c76", NAME="%k", MODE="0666" SYMLINK="mem_big"
KERNEL="sd*", SYSFS{idVendor}=="0ef5", NAME="%k", MODE="0666" SYMLINK="mem_red"

# Palm Pilot
KERNEL="ttyUSB[0-9]*",  NAME="tts/USB%n", SYSFS{product}="Palm Handheld", GROUP=
"tty", MODE="0666", SYMLINK="pilot"
I run 2.6.16.27 from get-go, disabled hotplug and have 755 permissions on rc.udev.

ps -ef | grep -i udev gives:
Code:
root      1021     1  0 01:35 ?        00:00:00 /sbin/udevd --daemon
As this is a clean install there are obviously no .new files in /etc/rc.d/ and furthermore, the custom rules I have created are no longer working, as the /dev/cdrom appears to be static, and the memory sticks don't get their correct device aliases either...

This previously worked with -current as of 10 days ago.

Anyone? Did I miss something in the changelog?

-Y1

Last edited by Yalla-One; 08-12-2006 at 07:20 PM.
 
Old 08-13-2006, 12:55 AM   #2
regis_n_bits
Member
 
Registered: Mar 2006
Distribution: Slackware64 14.1 (kernel 3.14.4)
Posts: 83

Rep: Reputation: Disabled
Yalla,

Quote:
Why does udev fully populate my /dev directory?
If you examine the /etc/udev/rules.d/udev.rules file you will see that udev will re-create most of the typical devices seen in the /dev directory.

As for your custom rules not working, the syntax for udev rules may have become more strict in the latest version (see the end of this thread):

http://www.linuxquestions.org/questi...d.php?t=472262
 
Old 08-13-2006, 03:09 AM   #3
Yalla-One
Member
 
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 635

Original Poster
Rep: Reputation: 35
2 problems down, one to go...

Thanks much regis_n_bits - you were spot on!

Quote:
Originally Posted by regis_n_bits
If you examine the /etc/udev/rules.d/udev.rules file you will see that udev will re-create most of the typical devices seen in the /dev directory.
Is there any benefit to this, or is this added purely for compatibility only? In my previous endevour with udev071 this was not the case and was not a problem. Do you know any links to where this might be documented?

Quote:
Originally Posted by regis_n_bits
As for your custom rules not working, the syntax for udev rules may have become more strict in the latest version (see the end of this thread):

http://www.linuxquestions.org/questi...d.php?t=472262
Can't believe I missed the new rules - thanks much - changed to == and += and now it works like a charm.

However, there's one last problem: When udev starts, it prints out this error message:
Code:
mount: wrong fs type, bad option, bad superblock on tmpfs,
       missing codepage or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

mkdir: cannot create directory `/dev/pts': File exists
mount: usbfs already mounted or /proc/bus/usb busy
mount: according to mtab, usbfs is already mounted on /proc/bus/usb
Starting udevd:  /sbin/udevd --daemon
See my fstab entry in initial post in this thread.
dmesg gives no hint, but syslog has:
Code:
Aug 13 10:08:17 asterix pcmcia-socket-startup: error in file 'config.opts' line 56: syntax error, unexpected STRING, expecting $end or INCLUDE or EXCLUDE
-Y1

Last edited by Yalla-One; 08-13-2006 at 03:10 AM.
 
Old 08-13-2006, 01:47 PM   #4
regis_n_bits
Member
 
Registered: Mar 2006
Distribution: Slackware64 14.1 (kernel 3.14.4)
Posts: 83

Rep: Reputation: Disabled
Good to see that your first two problems were easy to fix.

Quote:
Is there any benefit to this, or is this added purely for compatibility only? In my previous endevour with udev071 this was not the case and was not a problem. Do you know any links to where this might be documented?
Yeah I think it is only for compatibility. If you were really adventurous you could modify the files to reduce the number of devices created, but you really wouldn't gain anything (or worse you could corrupt something). Here is a link to a good document about udev rules:
http://www.reactivated.net/writing_udev_rules.html

For your mounting problem, the following lines are from the udev.rules file:
Code:
        # Mount tmpfs on /dev:
        if ! grep -E -q "^[^[:space:]]+ /dev tmpfs" /proc/mounts; then
            # umount shm if needed
            if grep -E -q "^[^[:space:]]+ /dev/shm tmpfs" /proc/mounts; then
                umount -l /dev/shm
            fi

            # Umount pts if needed, we will remount it later:
            if grep -E -q "^[^[:space:]]+ /dev/pts devpts" /proc/mounts; then
                umount -l /dev/pts
            fi

            # Mount tmpfs on /dev:
            # the -n is because we don't want /dev umounted when
            # someone (rc.[06]) calls umount -a
            mount -n -o mode=0755 -t tmpfs tmpfs /dev

            # Remount pts:
            mkdir /dev/pts
            mount -n -o mode=0620,gid=5 -t devpts devpts /dev/pts

            # Mount usbfs:
            if [ -d /proc/bus/usb ]; then
                mount usbfs -t usbfs /proc/bus/usb -o devgid=10,devmode=0666
            fi
        fi
This is where the first error message originates. I'm not really sure why you are getting these errors. I'll have to find out what the /dev directory is supposed to look like before udev starts.
 
  


Reply

Tags
udev, udevd


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
why has udev swapped /dev/hdc and /dev/hdd ? chaosbear Linux - Hardware 2 08-09-2006 03:23 AM
What is /dev/.udev.tdb? Andriy Slackware 4 04-19-2006 02:13 AM
How to add pseudo-terminals to /dev directory (Mandrake 10.1 & udev) blubery Mandriva 1 08-06-2005 12:46 PM
udev is about to beat me (/dev/null, etc) CowboyJ Linux - Hardware 5 07-06-2005 08:12 AM
how to tell udev to make a dev jimdaworm Slackware 10 08-13-2004 07:12 AM


All times are GMT -5. The time now is 06:38 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration