List Info

Thread: udev rules and boot + SCSI disks




udev rules and boot + SCSI disks
user name
2006-05-30 04:00:51
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=="SAMSUNG
SP..."

   BUS=scsi
   /dev/sdb  ->  SYSFS=="SysOp          
"

   BUS=scsi
   /dev/sdc  ->  SYSFS=="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=="SysOp          
"

   BUS=scsi
   /dev/sdb  ->  SYSFS=="Dados          
"

   BUS=scsi
   /dev/sdc  ->  SYSFS=="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=="SAMSUNG
SP123245", NAME="/dev/sda"
  BUS=="scsi", SYSFS=="SysOp       
   ", NAME="/dev/sdb"
  BUS=="scsi", SYSFS=="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-usergentoo.org mailing list

udev rules and boot + SCSI disks
user name
2006-05-30 05:58:24
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=="SAMSUNG
SP..."
>
>    BUS=scsi
>    /dev/sdb  ->  SYSFS=="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=="SysOp         
 "
>
>    BUS=scsi
>    /dev/sdb  ->  SYSFS=="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=="SAMSUNG
SP123245", NAME="/dev/sda"
>   BUS=="scsi", SYSFS=="SysOp  
        ", NAME="/dev/sdb"
>   BUS=="scsi", SYSFS=="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: dirk.heinrichscapgemini.com
Hambornerstraße 55      | Web:  http://www.capgemini.com
D-40472 Düsseldorf      | ICQ#: 110037733
GPG Public Key C2E467BB | Keyserver: www.keyserver.net
udev rules and boot + SCSI disks
user name
2006-05-30 06:28:02
On 5/29/06, Leandro Melo de Sales <leandroalgmail.com> wrote:
>   BUS=="scsi", SYSFS=="SAMSUNG
SP123245", NAME="/dev/sda"
>   BUS=="scsi", SYSFS=="SysOp  
        ", NAME="/dev/sdb"
>   BUS=="scsi", SYSFS=="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=="SAMSUNG SP123245",
NAME:="sda%n"
BUS=="scsi", KERNEL=="sd*",
SYSFS=="SysOp           ",
NAME:="sdb%n"
BUS=="scsi", KERNEL=="sd*",
SYSFS=="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-usergentoo.org mailing list

udev rules and boot + SCSI disks
user name
2006-05-30 13:53:33
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 <bigfishasmallpond.org>:
> On 5/29/06, Leandro Melo de Sales <leandroalgmail.com> wrote:
> >   BUS=="scsi",
SYSFS=="SAMSUNG SP123245",
NAME="/dev/sda"
> >   BUS=="scsi",
SYSFS=="SysOp           ",
NAME="/dev/sdb"
> >   BUS=="scsi",
SYSFS=="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=="SAMSUNG SP123245",
NAME:="sda%n"
> BUS=="scsi", KERNEL=="sd*",
SYSFS=="SysOp           ",
NAME:="sdb%n"
> BUS=="scsi", KERNEL=="sd*",
SYSFS=="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-usergentoo.org mailing list
>
>
-- 
gentoo-usergentoo.org mailing list

udev rules and boot + SCSI disks
user name
2006-05-30 14:00:46
Richard,

  You said that one rule can override other, but if you read
udev
manual ( ht
tp://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 <bigfishasmallpond.org>:
> On 5/29/06, Leandro Melo de Sales <leandroalgmail.com> wrote:
> >   BUS=="scsi",
SYSFS=="SAMSUNG SP123245",
NAME="/dev/sda"
> >   BUS=="scsi",
SYSFS=="SysOp           ",
NAME="/dev/sdb"
> >   BUS=="scsi",
SYSFS=="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=="SAMSUNG SP123245",
NAME:="sda%n"
> BUS=="scsi", KERNEL=="sd*",
SYSFS=="SysOp           ",
NAME:="sdb%n"
> BUS=="scsi", KERNEL=="sd*",
SYSFS=="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-usergentoo.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-usergentoo.org mailing list

udev rules and boot + SCSI disks
user name
2006-05-30 16:26:40
On 5/30/06, Leandro Melo de Sales <leandroalgmail.com> 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-usergentoo.org mailing list

udev rules and boot + SCSI disks
user name
2006-05-30 16:51:09
On 5/30/06, Leandro Melo de Sales <leandroalgmail.com> wrote:
> Richard,
>
>   You said that one rule can override other, but if you
read udev
> manual ( ht
tp://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-usergentoo.org mailing list

[1-7]

about | contact  Other archives ( Real Estate discussion Medical topics )