Re: [gentoo-user] udev rules and boot + SCSI disks

2006-05-30 Thread Dirk Heinrichs
Am Dienstag, 30. Mai 2006 06:00 schrieb ext Leandro Melo de Sales:

 When I boot from livecd the configuration of my disks is as follows:

BUS=scsi
/dev/sda  -  SYSFS{model}==SAMSUNG SP...

BUS=scsi
/dev/sdb  -  SYSFS{model}==SysOp   

SATA or real SCSI?

I got this information through udevinfo shell command.

/dev/sdb has BIOS boot priority, so I installed grub on it.

Try to give sda boot priority, install grub on it and tell grub to boot 
Linux from sdb, see if that helps.

   But when I boot the system with the kernel that I compiled (yes, I
 put all modules/drivers required for my scsi controllers and sata on
 it), the udev recognize the disks in a different order, such as:

BUS=scsi
/dev/sda  -  SYSFS{model}==SysOp   

BUS=scsi
/dev/sdb  -  SYSFS{model}==Dados   

Just a guess, maybe because of the boot prio.

   so, when gentoo activate udev the system shows a message that the
 boot device was not specified or not recognized. I go to shell and
 type dmesg, the disks is recognized but in such order that I said, not
 as the same as livecd. I started up the system with livecd again, than
 I created the file /etc/udev/rules.d/10-local.rules with the following
 rules:

   BUS==scsi, SYSFS{model}==SAMSUNG SP123245, NAME=/dev/sda
   BUS==scsi, SYSFS{model}==SysOp   , NAME=/dev/sdb
   BUS==scsi, SYSFS{model}==Dados   , NAME=/dev/sdc

   and finally I typed:

   # udevstartup
   # exit
   # umount /mnt/gentoo/dev/ /mnt/gentoo/proc /mnt/gentoo
   # reboot

   The system continue showing me the same message, after activate
 udev, the boot device was not find or not recognized.

Well, udev doesn't run until the kernel has booted.

   So, what I'm doing wrong? All pointers/suggestion are accepted. When
 I installed grub on /dev/sdb when I was on livecd everything went
 fine.

Could you post your grub.conf, partition information (/etc/fstab) and the 
relevant parts of dmesg output, please?

Bye...

Dirk
-- 
Dirk Heinrichs  | Tel:  +49 (0)162 234 3408
Configuration Manager   | Fax:  +49 (0)211 47068 111
Capgemini Deutschland   | Mail: [EMAIL PROTECTED]
Hambornerstraße 55  | Web:  http://www.capgemini.com
D-40472 Düsseldorf  | ICQ#: 110037733
GPG Public Key C2E467BB | Keyserver: www.keyserver.net


pgppRhQPckNBu.pgp
Description: PGP signature


Re: [gentoo-user] udev rules and boot + SCSI disks

2006-05-30 Thread Richard Fish

On 5/29/06, Leandro Melo de Sales [EMAIL PROTECTED] wrote:

  BUS==scsi, SYSFS{model}==SAMSUNG SP123245, NAME=/dev/sda
  BUS==scsi, SYSFS{model}==SysOp   , NAME=/dev/sdb
  BUS==scsi, SYSFS{model}==Dados   , NAME=/dev/sdc


1. You probably need the := syntax to prevent later rules from
over-riding your settings.  For example, in 50-udev.rules, I see:
50-udev.rules:KERNEL==sd*,NAME=%k, GROUP=disk

2. You should not have the /dev/ part of NAME.

3. You probably also need to handle the partitions with the %n syntax

So those rules should be more like:

BUS==scsi, KERNEL==sd*, SYSFS{model}==SAMSUNG SP123245, NAME:=sda%n
BUS==scsi, KERNEL==sd*, SYSFS{model}==SysOp   , NAME:=sdb%n
BUS==scsi, KERNEL==sd*, SYSFS{model}==Dados   , NAME:=sdc%n

You might also consider using LVM on these disks, so you need not care
about sdX, or mounting them by fileystem label.

-Richard
--
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] udev rules and boot + SCSI disks

2006-05-30 Thread Leandro Melo de Sales

Richard,

 when I change any rules, should I have to execute a command in order
to update the udev rules?

Thank you,

Leandro.

2006/5/30, Richard Fish [EMAIL PROTECTED]:

On 5/29/06, Leandro Melo de Sales [EMAIL PROTECTED] wrote:
   BUS==scsi, SYSFS{model}==SAMSUNG SP123245, NAME=/dev/sda
   BUS==scsi, SYSFS{model}==SysOp   , NAME=/dev/sdb
   BUS==scsi, SYSFS{model}==Dados   , NAME=/dev/sdc

1. You probably need the := syntax to prevent later rules from
over-riding your settings.  For example, in 50-udev.rules, I see:
50-udev.rules:KERNEL==sd*,NAME=%k, GROUP=disk

2. You should not have the /dev/ part of NAME.

3. You probably also need to handle the partitions with the %n syntax

So those rules should be more like:

BUS==scsi, KERNEL==sd*, SYSFS{model}==SAMSUNG SP123245, NAME:=sda%n
BUS==scsi, KERNEL==sd*, SYSFS{model}==SysOp   , NAME:=sdb%n
BUS==scsi, KERNEL==sd*, SYSFS{model}==Dados   , NAME:=sdc%n

You might also consider using LVM on these disks, so you need not care
about sdX, or mounting them by fileystem label.

-Richard
--
gentoo-user@gentoo.org mailing list



--
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] udev rules and boot + SCSI disks

2006-05-30 Thread Leandro Melo de Sales

Richard,

 You said that one rule can override other, but if you read udev
manual ( http://www.reactivated.net/writing_udev_rules.html ), you'll
realize that what you said I think is incorrect.

Files in /etc/udev/rules.d/ are parsed in lexical order. udev will
stop processing rules as soon as it finds a matching rule in a file
for the new item of hardware that has been detected. It is important
that your own rules get processed before the udev defaults, otherwise
your own naming schemes will not take effect! I suggest that you keep
your own rules in a file at /etc/udev/rules.d/10-local.rules (this
doesn't exist by default - create it). As 10 comes before 50, you know
that your rules will be looked at first. It is important that the
filenames of your rule files end with the .rules suffix, otherwise
they will not be used.

Let me know if I am wrong too? :-)

Leandro.

2006/5/30, Richard Fish [EMAIL PROTECTED]:

On 5/29/06, Leandro Melo de Sales [EMAIL PROTECTED] wrote:
   BUS==scsi, SYSFS{model}==SAMSUNG SP123245, NAME=/dev/sda
   BUS==scsi, SYSFS{model}==SysOp   , NAME=/dev/sdb
   BUS==scsi, SYSFS{model}==Dados   , NAME=/dev/sdc

1. You probably need the := syntax to prevent later rules from
over-riding your settings.  For example, in 50-udev.rules, I see:
50-udev.rules:KERNEL==sd*,NAME=%k, GROUP=disk

2. You should not have the /dev/ part of NAME.

3. You probably also need to handle the partitions with the %n syntax

So those rules should be more like:

BUS==scsi, KERNEL==sd*, SYSFS{model}==SAMSUNG SP123245, NAME:=sda%n
BUS==scsi, KERNEL==sd*, SYSFS{model}==SysOp   , NAME:=sdb%n
BUS==scsi, KERNEL==sd*, SYSFS{model}==Dados   , NAME:=sdc%n

You might also consider using LVM on these disks, so you need not care
about sdX, or mounting them by fileystem label.

-Richard
--
gentoo-user@gentoo.org mailing list





--
Leandro Melo de Sales.
Computer Science Student
Laboratório de Sistemas Distribuídos - www.lsd.ufcg.edu.br
Laboratório de Sistemas Embarcados e Computação Pervasiva -
www.embeddedacademy.org
Universidade Federal de Campina Grande - UFCG
Campina Grande - PB - Brasil

--
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] udev rules and boot + SCSI disks

2006-05-30 Thread Richard Fish

On 5/30/06, Leandro Melo de Sales [EMAIL PROTECTED] wrote:

Richard,

  when I change any rules, should I have to execute a command in order
to update the udev rules?


Usually you can run udevstart to get the new nodes activated
immediately.  But if you are just going to reboot, this is not
necessary.

-Richard
--
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] udev rules and boot + SCSI disks

2006-05-30 Thread Richard Fish

On 5/30/06, Leandro Melo de Sales [EMAIL PROTECTED] wrote:

Richard,

  You said that one rule can override other, but if you read udev
manual ( http://www.reactivated.net/writing_udev_rules.html ), you'll
realize that what you said I think is incorrect.


That is _not_ the udev manual.  I've also found that page to be
frequently out of date (it still listed the comparison operator as '='
instead of '==' for months after that changed).


From man udev:

  := Assign a value to a key finally; disallow any later changes,
which may be used to prevent changes by any later rules.

And from /usr/share/doc/udev-*/RELEASE-NOTES.gz:

quote
udev 059

...
o The rule keys support now more operations. This is documented in the
 man page. It is possible to add values to list-keys like the SYMLINK
 and RUN list with KEY+=value and to clear the list by assigning KEY=.
 Also final-assignments are supported by using KEY:=value, which will
 prevent changing the key by any later rule.
...
udev 057

All rules are applied now, but only the first matching rule with a NAME-key
will be applied. All later rules with NAME-key are completely ignored. This
way system supplied symlinks or permissions gets applied to user-defined
naming rules.
/quote

So it looks like I am wrong about needing the := syntax when your rule
assigns the NAME.  I just tested the behavior with udev-090 and my USB
flash drive, and it works as the RELEASE-NOTES say.  But I also had a
problem with naming my input devices that was fixed with the :=
syntax.

-Richard
--
gentoo-user@gentoo.org mailing list



[gentoo-user] udev rules and boot + SCSI disks

2006-05-29 Thread Leandro Melo de Sales

Hi...

 I made a gentoo installation by reading gentoo installation guide.
When I boot from livecd the configuration of my disks is as follows:

  BUS=scsi
  /dev/sda  -  SYSFS{model}==SAMSUNG SP...

  BUS=scsi
  /dev/sdb  -  SYSFS{model}==SysOp   

  BUS=scsi
  /dev/sdc  -  SYSFS{model}==Dados   

  I got this information through udevinfo shell command.

  /dev/sdb has BIOS boot priority, so I installed grub on it.

 But when I boot the system with the kernel that I compiled (yes, I
put all modules/drivers required for my scsi controllers and sata on
it), the udev recognize the disks in a different order, such as:

  BUS=scsi
  /dev/sda  -  SYSFS{model}==SysOp   

  BUS=scsi
  /dev/sdb  -  SYSFS{model}==Dados   

  BUS=scsi
  /dev/sdc  -  SYSFS{model}==SAMSUNG SP123245

 so, when gentoo activate udev the system shows a message that the
boot device was not specified or not recognized. I go to shell and
type dmesg, the disks is recognized but in such order that I said, not
as the same as livecd. I started up the system with livecd again, than
I created the file /etc/udev/rules.d/10-local.rules with the following
rules:

 BUS==scsi, SYSFS{model}==SAMSUNG SP123245, NAME=/dev/sda
 BUS==scsi, SYSFS{model}==SysOp   , NAME=/dev/sdb
 BUS==scsi, SYSFS{model}==Dados   , NAME=/dev/sdc

 and finally I typed:

 # udevstartup
 # exit
 # umount /mnt/gentoo/dev/ /mnt/gentoo/proc /mnt/gentoo
 # reboot

 The system continue showing me the same message, after activate
udev, the boot device was not find or not recognized.

 So, what I'm doing wrong? All pointers/suggestion are accepted. When
I installed grub on /dev/sdb when I was on livecd everything went
fine.

Thank you,

Leandro.
--
gentoo-user@gentoo.org mailing list