# Udev

## ThinkTank89

I'm adding udev as my device manager ( yes, dont worry, I'm on 2.6 :-p ). In /etc/conf.d/rc I had RC-DEVICE_TARBALL="yes" I changed it to ="no", I had RC_NET_STRICT_CHECKING="no", I left that, and, I had to ADD IN RC_DEVICES="udev"

I'm suppried all I had to do was add this RC_DEVICES="udev" line in, do I have to comment anything else out? Change any other lines? Is that really it, just add it in?

----------

## pitcrawler

Just make sure you read the Gentoo udev guide and you'll be fine.

----------

## cancech

I tried installing udev onto my computer, I was trying to get my usb stick to mount properly  (see https://forums.gentoo.org/viewtopic-t-306198-start-25.html) and I seem to have screwed something up. When I rebooted it got as far as "checking root filesystem" and then I get the following error:

 *Quote:*   

> 
> 
> fsck.ext3: no such file or directory while trying to open /dev/hda3 
> 
> /dev/hda3:
> ...

 

At this point I can get into the computer, but only to the command line as root.

I followed the Gentoo udev guide and I also went through the Decible's primer and followed all the steps there (except for #7 - where you set it up for a udev only system). I disabled /dev filesystem support in the kernel as part of the install - I think that this is where the problem is.  Is there someway I could "rollabck" the changes I made? I tried manually editing the files, but they are read only and I can't change them. What I need now is a quick fix. I can make due without the computer, but there's an assignment on it which is due tommorow and I have at the moment no way of getting it off the computer....

EDIT: I just checked under /dev and there is a bunch of stuff there, but hda1, hda3 are missing.....

I managed to save the assignment via the fatefull usb stick, so there isn't such a hurry anymore

----------

## ARC2300

 *cancech wrote:*   

> I tried installing udev onto my computer, I was trying to get my usb stick to mount properly  (see https://forums.gentoo.org/viewtopic-t-306198-start-25.html) and I seem to have screwed something up. When I rebooted it got as far as "checking root filesystem" and then I get the following error:
> 
>  *Quote:*   
> 
> fsck.ext3: no such file or directory while trying to open /dev/hda3 
> ...

 

In your /etc/fstab, for your / directory, reference /dev/discs/disc0/part3 instead of /dev/hda3.  I had the same thing pop up (errorwise) and /dev/hd* wasn't there yet.  Don't know why.  

Why not go with a udev only system??  It's just as good as a devfs system, as far as I've seen.  No issues yet (other than having to reference the root partition with /dev/disc/discX/partX).

----------

## cancech

That seems to be a goo idea except for one small detail......I can't edit /etc/fstab. I can get to it, make the changes, but when I go to save them the I get an error saying that: "The file is read only". The same for the rest of the hdd. During boot it hasn't gotten far enough to not make them read only yet. I've been trying to mount the /dev/discs/disc0/part3 seperately, but with no success. I make a directory in /dev, try to mount it and I get an error saying that it's already mounted or that /dev/temp is busy (a directory I just made). I try to unmout /dev/discs/disc0/part3 and I get the error that it's not mounted yet..... I can mount my boot partition, but that's not helping much. Any ideas how to get around the read only issue?

----------

## cancech

I managed to fix my problem with fstab by running from the gentoo live cd   :Razz: 

As for going only udev, I'll take a look at what it entails and I might. Right now I'm happy that it works  :Wink: 

Is there somesorta manual detailing how to "use" udev?

----------

## ARC2300

 *cancech wrote:*   

> I managed to fix my problem with fstab by running from the gentoo live cd  
> 
> As for going only udev, I'll take a look at what it entails and I might. Right now I'm happy that it works 
> 
> Is there somesorta manual detailing how to "use" udev?

 

If I remember correctly, you just don't compile in devfs support with the kernel, and udev takes over.

Check the Gentoo udev guide.

----------

## cancech

Ok, I found a udev howto and I've been fiddling around with the udev rules. I've been trying to set it up in such a way that when I plug in my usb memory stick it appears in /dev/usb_stick and when my eternal hard disk is plugged in it appears in /dev/usb_hdd. Here are the rules that I've created.

```

BUS="usb", SYSFS{manufacturer}="SanDisk Corp.", SYSFS{product}="Cruzer Micro", SYMLINK="usb_stick"

BUS="scsi", SYSFS{model}="OneTouch        ", SYSFS{vendor}="Maxtor  ", SYMLINK="usb_hdd"

```

 I've made an entry for both of them in fstab, but when I try to mount I get a "not a nlock device" error. Any ideas on what I messed up?

Here's my fstab file.

```

# /etc/fstab: static file system information.

# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/fstab,v 1.14 2003/10/13 20:03:38 azarah Exp $

#

# noatime turns off atimes for increased performance (atimes normally aren't

# needed; notail increases performance of ReiserFS (at the expense of storage

# efficiency).  It's safe to drop the noatime options if you want and to

# switch between notail and tail freely.

# <fs>                  <mountpoint>    <type>          <opts>                  <dump/pass>

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.

/dev/discs/disc0/part1          /boot                ext2            defaults,noatime            1 2

/dev/discs/disc0/part3          /                      ext3            noatime                         0 1

/dev/discs/disc0/part2          none                swap            sw                                0 0

/dev/cdroms/cdrom1            /mnt/cdrom      auto            users,ro,exec,noauto       0 0

/dev/cdrom              /mnt/dvd        auto            users,ro,noauto,exec                    0 0

/dev/usb_stick          /mnt/usb        auto            users,noatime,exec,noauto            0 0

/dev/usb_hdd           /mnt/hdd        auto            users,noatime,exec,noauto            0 0

# NOTE: The next line is critical for boot!

none                    /proc           proc            defaults                0 0

# glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for

# POSIX shared memory (shm_open, shm_unlink).

# (tmpfs is a dynamically expandable/shrinkable ramdisk, and will

#  use almost no memory if not populated with files)

# Adding the following line to /etc/fstab should take care of this:

none                    /dev/shm        tmpfs           defaults                0 0

```

----------

## cancech

Well, I've been playing around with this a little bit more, and I got the usb stick mounted....but I couldn't unmount it afterwards.

----------

## kmare

hi,

if I disable devfs from the kernel, then I can't boot my system. udev isn't taking over. So the system cannot find a device to boot... I followed the doc on www.gentoo.org/doc about udev. I don't think I missed anything, it's pretty simple... emerge udev, emerge hotplug and add it to the boot runlevel. devfsd is started automatically (when I enable it in kernel) even if I pass gentoo=nodevfs to grub, and udevd is started too when I do a ps -ef|grep udev. I really don't understand what I'm missing here...

thanx for your help..

PS: I don't have RC_DEVICES="udev" in /etc/conf.d/rc, is that the problem?

----------

## kmare

nope  :Sad:  RC_DEVICES="udev" in /etc/conf.d/rc didn't help... anyone?

thanx

----------

## ninjaboy13

Did you emerge udev?

This is what I did to install it:

 Instructions

   1. emerge udev

   2. edit /etc/conf.d/rc

   3. edit /etc/udev/*

   4. update your kernel boot options to include "nodevfs udev devfs=nomount"

   5. reboot

   6. enjoy 

(I'm going to write a somewhat longer article about this soon)

Hint 1: You can do a emerge -C devfsd, after udev works

Hint 2: If you are using genkernel, you will need to use version 3.0.2f or later, and specify --udev on the command-line. Otherwise, the initrd will always mount the devfs.

Hint 3: If your graphics screen does not run and you get stuck in command-line mode, try editing xorg.conf or XF86Config and change the mouse device to "/dev/input/mice".

Hint 4: In /etc/conf.d/rc, You might need to enable the "rc-scripts dep-cache directory" 

P.S.-This is from http://gentoo-wiki.com/

----------

## kmare

thanx!! I appended the wrong kernel parameters... I mispelled devfs! anyway.. thanx for pointing it out  :Smile:  it's working great now.. without doing anything at all!

----------

