Skip to contentSkip to conversation

udev

DISCUSSION Greg KH 7 participants 13 messages Aug 11, 2005 – Mar 22, 2011

lore
Share & tools
lore

Greg KH

author
#0 lore raw
Quoted 8 lines · Mike

hey;

I've setup Raid1 on two SATA drives on my FC3 system. as well there are several other SATA drives in the system that are not in the raid. I wanted to make static mappings to the /dev devices. I've created a rules file and according to the logs its reading the rules files I created.

...

Quoted 8 lines
Aug 09 21:34:42 localhost udev[10536]: configured rule in 
'/etc/udev/rules.d/10-udev.rules' at line 4 applied, 'sdd' becomes '%k'
Aug 09 21:34:42 localhost udev[10536]: creating device node '/dev/sdd'

...

but if I remove on of the drives from the system. It will read the rules file only up to where the non present drive is then switch to the defaults which removes the satic maps and breaks the raid.

What does running udevtest show for that situation?

thanks,

greg k-h

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#1 lore raw

hey;

I've setup Raid1 on two SATA drives on my FC3 system. as well there are several other SATA drives in the system that are not in the raid. I wanted to make static mappings to the /dev devices. I've created a rules file and according to the logs its reading the rules files I created.

...

Aug 09 21:34:42 localhost udev[10536]: configured rule in 
'/etc/udev/rules.d/10-udev.rules' at line 4 applied, 'sdd' becomes '%k'
Aug 09 21:34:42 localhost udev[10536]: creating device node '/dev/sdd'

...

but if I remove on of the drives from the system. It will read the rules file only up to where the non present drive is then switch to the defaults which removes the satic maps and breaks the raid.

rules file:

BUS="scsi", ID="0:0:0:0", KERNEL="sda", NAME="%k"
BUS="scsi", ID="1:0:0:0", KERNEL="sdb", NAME="%k"
BUS="scsi", ID="1:0:0:0", KERNEL="sdb", NAME="%k"
BUS="scsi", ID="2:0:0:0", KERNEL="sdc", NAME="%k"
BUS="scsi", ID="3:0:0:0", KERNEL="sdd", NAME="%k"
BUS="scsi", ID="4:0:0:0", KERNEL="sde", NAME="%k"
BUS="scsi", ID="5:0:0:0", KERNEL="sdf", NAME="%k"
BUS="scsi", ID="6:0:0:0", KERNEL="sdg", NAME="%k"

If I'm doing something wrong or in anyone has and suggestions

thanks
Mike

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

author
#2 lore raw
In reply to Greg KH
Quoted 15 lines · Mike

running udev on each disk gave me

[root@localhost udev-065]# udevtest /sys/block/sdb
version 039
looking at '/block/sdb'
configured rule in '/etc/udev/rules.d/10-udev.rules' at line 2 applied, added
symlink 'raid11'
configured rule in '/etc/udev/rules.d/10-udev.rules' at line 2 applied, 'sdb'
becomes '%k'
creating device node '/dev/sdb', major = '8', minor = '16', mode = '060660', uid
= '0', gid = '6'

Quoted 2 lines

for all the disk that were present. I removed sda before running the test. The sda drive returns looking at /block/sda and dosn't go any further.

I'm not sure I understand the problem then. Your example file did not have a symlink in it, yet udevtest shows it applying one above...

thanks,

greg k-h

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#3 lore raw
In reply to Greg KH

running udev on each disk gave me

[root@localhost udev-065]# udevtest /sys/block/sdb
version 039
looking at '/block/sdb'
configured rule in '/etc/udev/rules.d/10-udev.rules' at line 2 applied, added
symlink 'raid11'
configured rule in '/etc/udev/rules.d/10-udev.rules' at line 2 applied, 'sdb'
becomes '%k'
creating device node '/dev/sdb', major = '8', minor = '16', mode = '060660', uid
= '0', gid = '6'

for all the disk that were present. I removed sda before running the test. The sda drive returns looking at /block/sda and dosn't go any further.

thanks
Mike

Quoted 20 lines · Greg KH
Quoted 8 lines · Mike

hey;

I've setup Raid1 on two SATA drives on my FC3 system. as well there are several other SATA drives in the system that are not in the raid. I wanted to make static mappings to the /dev devices. I've created a rules file and according to the logs its reading the rules files I created.

...

Quoted 8 lines
Aug 09 21:34:42 localhost udev[10536]: configured rule in 
'/etc/udev/rules.d/10-udev.rules' at line 4 applied, 'sdd' becomes '%k'
Aug 09 21:34:42 localhost udev[10536]: creating device node '/dev/sdd'

...

but if I remove on of the drives from the system. It will read the rules file only up to where the non present drive is then switch to the defaults which removes the satic maps and breaks the raid.

Quoted 6 lines

What does running udevtest show for that situation?

thanks,

greg k-h

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#4 lore raw
In reply to Greg KH
Quoted 15 lines · Mike

running udev on each disk gave me

[root@localhost udev-065]# udevtest /sys/block/sdb
version 039
looking at '/block/sdb'
configured rule in '/etc/udev/rules.d/10-udev.rules' at line 2 applied, added
symlink 'raid11'
configured rule in '/etc/udev/rules.d/10-udev.rules' at line 2 applied, 'sdb'
becomes '%k'
creating device node '/dev/sdb', major = '8', minor = '16', mode = '060660', uid
= '0', gid = '6'

Quoted 2 lines

for all the disk that were present. I removed sda before running the test. The sda drive returns looking at /block/sda and dosn't go any further.

I don't think that you can rely on the scsi enumeration to make stable nodes, but I'm not entirely sure in your case.

Better try to read some persistent data from the drive itself like the serial number. You may look at the persistent device naming rules:
http://kernel.org/git/gitweb.cgi?p=linux/hotplug/udev.git;a=blob;h�08f5068df7c1b2e0c994c63489069af054b362;hb�7fd445bd9ade720776f661a4ad7c4b2202d6f0;f=etc/udev/gentoo/udev.rules#l246

and see if you can get unique properties from your drive with ata_id or scsi_id.

Good luck,
Kay

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#5 lore raw
In reply to Greg KH

The main problem I was having is that when the system starts and all the drives are there udev used my rules file and everything works. The moment the system starts and say sdc is missing, it will read the file and apply the rules for sda and sdb, but not apply it to any other the drives from that point on. The default system takes over, so a drive that I need to be sdd ends up being sdc.

I had though about that, but wouldn't you have to regenerate the file each time if there was a drive change? I figured the SCSI enumeration would work the best, in the event of a fail the new drive can be plugged in to the same particular channel and in be labeled correctly. I'll take a look further in to the using the scsi_id

thanks
mike

Quoted 28 lines · Kay Sievers
Quoted 15 lines · Mike

running udev on each disk gave me

[root@localhost udev-065]# udevtest /sys/block/sdb
version 039
looking at '/block/sdb'
configured rule in '/etc/udev/rules.d/10-udev.rules' at line 2 applied, added
symlink 'raid11'
configured rule in '/etc/udev/rules.d/10-udev.rules' at line 2 applied, 'sdb'
becomes '%k'
creating device node '/dev/sdb', major = '8', minor = '16', mode = '060660', uid
= '0', gid = '6'

Quoted 2 lines

for all the disk that were present. I removed sda before running the test. The sda drive returns looking at /block/sda and dosn't go any further.

I don't think that you can rely on the scsi enumeration to make stable nodes, but I'm not entirely sure in your case.

Better try to read some persistent data from the drive itself like the serial number. You may look at the persistent device naming rules:
http://kernel.org/git/gitweb.cgi?p=linux/hotplug/udev.git;a=blob;hÒ08f5068df7c1b2e0c994c63489069af054b362;hbÔ7fd445bd9ade720776f661a4ad7c4b2202d6f0;f=etc/udev/gentoo/udev.rules#l246

Quoted 6 lines

and see if you can get unique properties from your drive with ata_id or scsi_id.

Good luck,
Kay

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

author
#6 lore raw
In reply to Greg KH
Quoted 7 lines · Mike

The main problem I was having is that when the system starts and all the drives are there udev used my rules file and everything works. The moment the system starts and say sdc is missing, it will read the file and apply the rules for sda and sdb, but not apply it to any other the drives from that point on. The default system takes over, so a drive that I need to be sdd ends up being sdc.

Quoted 5 lines

I had though about that, but wouldn't you have to regenerate the file each time if there was a drive change? I figured the SCSI enumeration would work the best, in the event of a fail the new drive can be plugged in to the same particular channel and in be labeled correctly. I'll take a look further in to the using the scsi_id

Yes, use scsi_id, or a sysfs attribute. Not the scsi enumerated number, that will change all the time.

good luck,

greg k-h

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#7 lore raw
In reply to Greg KH

Hello !
My name is Oleg. I am from Russia.
I build linux from scratch. Currently my system have busybox and libc. I install udev, but it's not work.

$ /sbin/udevd --daemon
run, but do nothing (/dev/ is clean)
sysfs mounted to /sys
tmpfs mounted ot /dev

Please, helpl my.
Oleg.

#8 lore raw
In reply to Greg KH

Здравуствуйте !
Простите, что на русском, с английским туго.
Так вот. Собираю свою систему (с нуля). Установил busybox и libc. Затем установил в / udev . Пробую запускать

$ /sbin/udevd --daemon
Запускается, но /dev остается девственно пустым. Подскажите,
пожалуйста , в чем может быть проблема ?

sysfs смонтирован на /sys
proc на /proc
tmpfs на /dev

Олег.
ЪТХ╨{.nг+┴╥÷╝┴╜├+%┼кЪ╠Ищ╤╔┼wЪ╨{.nг+┴╥╔┼{╠Ч-╕[═Ч)М┘ФХw*jg╛╠╗╤┴ ▌┼щ╒jЪ╬╚ЧG╚²ИЪ╒╦ ╒╥╕j:+v┴╗┼wХjьm╤÷ЪЧЬ╞Ы╝w╔Ч┼ЮЧfё╒╥h ▐Б²ЗЪ├ы╔

#9 lore raw
In reply to Greg KH
Quoted 9 lines · On Monday 02 of November 2009 14:10:56 Oleg Puchinin wrote:

Hello !
My name is Oleg. I am from Russia.
I build linux from scratch. Currently my system have busybox and
libc. I install udev, but it's not work.

$ /sbin/udevd --daemon
run, but do nothing (/dev/ is clean)
sysfs mounted to /sys
tmpfs mounted ot /dev

udevd only responds to external events. To force udevd to (re-)create nodes for devices that already exist run "udevadm trigger". You can further fine tune which devices will be triggered; look at udevadm manual.

#10 lore raw
In reply to Greg KH
Quoted 11 lines · Andrey Borzenkov
Quoted 9 lines · On Monday 02 of November 2009 14:10:56 Oleg Puchinin wrote:

Hello !
My name is Oleg. I am from Russia.
I build linux from scratch. Currently my system have busybox and
libc. I install udev, but it's not work.

$ /sbin/udevd --daemon
run, but do nothing (/dev/ is clean)
sysfs mounted to /sys
tmpfs mounted ot /dev
Quoted 4 lines

udevd only responds to external events. To force udevd to (re-)create nodes for devices that already exist run "udevadm trigger". You can further fine tune which devices will be triggered; look at udevadm manual.

You probably also want to wait for the device nodes to be created, using udevadm settle.

Alan

#12 lore raw

Re: Udev

In reply to Greg KH
Quoted 1 line · Paulo Eliseu Weber

I wonder which version of Udev is compatible with kernel 2.6.16 (Debian).

This is the upstream development list, where almost nobody runs such old stuff anymore. Please try if the Debian guys know anything about it, there are much more distro specific dependencies than kernel ones.

Kay