mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: Persistent device numbers
       [not found] <mailman.996733981.23626.linux-kernel2news@redhat.com>
@ 2001-08-02 17:15 ` Pete Zaitcev
  0 siblings, 0 replies; 8+ messages in thread
From: Pete Zaitcev @ 2001-08-02 17:15 UTC (permalink / raw)
  To: Andrej.Borsenkow, linux-kernel

> As far as I understand, currently kernel assigns device numbers dynamically.

That's why mount by label exists

[zaitcev@niphredil zaitcev]$ cat /etc/fstab
LABEL=/                 /                       ext2    defaults        1 1
/dev/fd0                /mnt/floppy             auto    noauto,owner    0 0
none                    /proc                   proc    defaults        0 0
none                    /dev/pts                devpts  gid=5,mode=620  0 0

> Do I miss something and Linux has such mechanism?

Not really... Gooch says it is needed and he has a patch for it,
check it out too. Most of it can be resolved by other means.

-- Pete

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: Persistent device numbers
  2001-08-02 14:37 ` Alan Cox
  2001-08-02 20:05   ` Kurt Garloff
@ 2001-08-08  7:27   ` Borsenkow Andrej
  1 sibling, 0 replies; 8+ messages in thread
From: Borsenkow Andrej @ 2001-08-08  7:27 UTC (permalink / raw)
  To: linux-kernel



To summarize what I've got so far.

1. To answer the question - I try to solve a problem of persistent
device (in general sense, meaning scsi0, eth2, disk3 etc) naming :-) I
want to avoid, that rebooting with failing Ethernet card or plugging in
additional SCSI controller suddenly moves eth1 into eth0 or scsi0 to
scsi1. I want to make sure that a given physical device always is
referred to by the same name irrespectively of any other configuration
changes.

2. I generally agree that it is mostly user-space problem. With the
large if - *if* kernel provides unique physical device identification.
Currently it is not the case. Just review recent thread " How does
"alias ethX drivername" in modules.conf work?"
(http://www.uwsg.indiana.edu/hypermail/linux/kernel/0108.0/1230.html).
There is no way to assure that an Ethernet controller plugged into slot
3 of my PCI bus is always named eth2.

3. devfs does not help here. It provides consistent view of *logical*
namespace - but it changes nothing in how physical devices are mapped
into logical.

What Linux lacks is the ability to refer to devices by there unique path
(please, call it whatever you want, I just find it natural and it is
used in many systems). You may not have module loaded that controls card
in PCI slot 3 but you *do* know that you have a card there and that the
card is of type network (from PCI id). So, you can refer to this card
even if module is not loaded. What I basically suggest is to shift
logical number allocation from actual drivers into upper layer (PCI in
this case). Then SCSI/Ethernet/whatever drivers will get logical numbers
already assigned. And of course tool to assign these numbers belongs to
user space :-)

There are cases when it is not possible. Legacy ISA is an example. In
this case you have no way but reserve some numbers and assign them to
cards using IRQ/Port as it is currently. It seems doable.

-andrej

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Persistent device numbers
  2001-08-02 14:37 ` Alan Cox
@ 2001-08-02 20:05   ` Kurt Garloff
  2001-08-08  7:27   ` Borsenkow Andrej
  1 sibling, 0 replies; 8+ messages in thread
From: Kurt Garloff @ 2001-08-02 20:05 UTC (permalink / raw)
  To: Alan Cox; +Cc: Borsenkow Andrej, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 519 bytes --]

On Thu, Aug 02, 2001 at 03:37:49PM +0100, Alan Cox wrote:
> You are mostly talking about a user space problem in reality. Things like
> scsiinfo for example build a directory of scsi path based names to the
> disks, and the mount code supports mounting by volume label.

scsidev.

Regards,
-- 
Kurt Garloff  <garloff@suse.de>                          Eindhoven, NL
GPG key: See mail header, key servers         Linux kernel development
SuSE GmbH, Nuernberg, DE                                SCSI, Security

[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Persistent device numbers
  2001-08-02 10:20 ` Christoph Hellwig
@ 2001-08-02 17:06   ` Greg KH
  0 siblings, 0 replies; 8+ messages in thread
From: Greg KH @ 2001-08-02 17:06 UTC (permalink / raw)
  To: Borsenkow Andrej, linux-kernel

On Thu, Aug 02, 2001 at 12:20:35PM +0200, Christoph Hellwig wrote:
> > Most commercial systems (O.K. those I looked into) have some sort of logical
> > device numbering that assigns fixed name based on some unique hardware
> > address (cf /etc/path_to_inst in Solaris). Hardware address usually is a
> > path needed to access device - i.e. Bus/Slot/Channel[/drive id], so that you
> > can set
> >
> > PCI0/Slot3/Channel1 == eth3
> >
> > and this never changes if you add or remove any card.
> >
> > Do I miss something and Linux has such mechanism?
> 
> For some device-types this is provided be userspace tools.  E.g. LVM
> provides persistan names for it's deice by stroing name and UUID on disk,
> 'normal' filesystems can be mounted by UUID or label and Andi Kleen has
> a tool that allows naming network interfaces by MAC addresses.

Yes, and combine the 'nameif' program with the linux-hotplug scripts and
you can have your network devices always be named correctly
automatically when the interface starts up.

greg k-h

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Persistent device numbers
  2001-08-02  6:30 Borsenkow Andrej
  2001-08-02  9:50 ` Chris Wedgwood
  2001-08-02 10:20 ` Christoph Hellwig
@ 2001-08-02 14:37 ` Alan Cox
  2001-08-02 20:05   ` Kurt Garloff
  2001-08-08  7:27   ` Borsenkow Andrej
  2 siblings, 2 replies; 8+ messages in thread
From: Alan Cox @ 2001-08-02 14:37 UTC (permalink / raw)
  To: Borsenkow Andrej; +Cc: linux-kernel

> As far as I understand, currently kernel assigns device numbers dynamically.
> It means, that actual, user visible, controller/drive name may change if

To an extent

> Most commercial systems (O.K. those I looked into) have some sort of logical
> device numbering that assigns fixed name based on some unique hardware
> address (cf /etc/path_to_inst in Solaris). Hardware address usually is a
> path needed to access device - i.e. Bus/Slot/Channel[/drive id], so that you
> can set
> 
> PCI0/Slot3/Channel1 == eth3
> 
> and this never changes if you add or remove any card.
> 
> Do I miss something and Linux has such mechanism?

You are mostly talking about a user space problem in reality. Things like
scsiinfo for example build a directory of scsi path based names to the
disks, and the mount code supports mounting by volume label.

You might want to look at devfs too, its not my favourite solution but it
does offer  most of what you are describing

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Persistent device numbers
  2001-08-02  6:30 Borsenkow Andrej
  2001-08-02  9:50 ` Chris Wedgwood
@ 2001-08-02 10:20 ` Christoph Hellwig
  2001-08-02 17:06   ` Greg KH
  2001-08-02 14:37 ` Alan Cox
  2 siblings, 1 reply; 8+ messages in thread
From: Christoph Hellwig @ 2001-08-02 10:20 UTC (permalink / raw)
  To: Borsenkow Andrej; +Cc: linux-kernel

In article <000901c11b1c$a87b1f40$21c9ca95@mow.siemens.ru> you wrote:
> As far as I understand, currently kernel assigns device numbers dynamically.
> It means, that actual, user visible, controller/drive name may change if
>
> - hardware configuaration is changed (added ot removed controller, added or
> removed drive)
>
> - for some reasons order of initialisation in kernel changes (which may
> result in nasty surprise after update)
>
> Moreover, it near to impossible to know which name device gets in advance
> (or why it gets this name).
>
> Most commercial systems (O.K. those I looked into) have some sort of logical
> device numbering that assigns fixed name based on some unique hardware
> address (cf /etc/path_to_inst in Solaris). Hardware address usually is a
> path needed to access device - i.e. Bus/Slot/Channel[/drive id], so that you
> can set
>
> PCI0/Slot3/Channel1 == eth3
>
> and this never changes if you add or remove any card.
>
> Do I miss something and Linux has such mechanism?

For some device-types this is provided be userspace tools.  E.g. LVM
provides persistan names for it's deice by stroing name and UUID on disk,
'normal' filesystems can be mounted by UUID or label and Andi Kleen has
a tool that allows naming network interfaces by MAC addresses.

	Christoph

-- 
Of course it doesn't work. We've performed a software upgrade.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Persistent device numbers
  2001-08-02  6:30 Borsenkow Andrej
@ 2001-08-02  9:50 ` Chris Wedgwood
  2001-08-02 10:20 ` Christoph Hellwig
  2001-08-02 14:37 ` Alan Cox
  2 siblings, 0 replies; 8+ messages in thread
From: Chris Wedgwood @ 2001-08-02  9:50 UTC (permalink / raw)
  To: Borsenkow Andrej; +Cc: linux-kernel

On Thu, Aug 02, 2001 at 10:30:44AM +0400, Borsenkow Andrej wrote:

    Do I miss something and Linux has such mechanism?

what problem are you trying to solve? if its disk moving about, then
you need to do things differently

anyhow, look at devfs if you really want 'static' device assignments



  --cw


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Persistent device numbers
@ 2001-08-02  6:30 Borsenkow Andrej
  2001-08-02  9:50 ` Chris Wedgwood
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Borsenkow Andrej @ 2001-08-02  6:30 UTC (permalink / raw)
  To: linux-kernel

As far as I understand, currently kernel assigns device numbers dynamically.
It means, that actual, user visible, controller/drive name may change if

- hardware configuaration is changed (added ot removed controller, added or
removed drive)

- for some reasons order of initialisation in kernel changes (which may
result in nasty surprise after update)

Moreover, it near to impossible to know which name device gets in advance
(or why it gets this name).

Most commercial systems (O.K. those I looked into) have some sort of logical
device numbering that assigns fixed name based on some unique hardware
address (cf /etc/path_to_inst in Solaris). Hardware address usually is a
path needed to access device - i.e. Bus/Slot/Channel[/drive id], so that you
can set

PCI0/Slot3/Channel1 == eth3

and this never changes if you add or remove any card.

Do I miss something and Linux has such mechanism?

TIA

-andrej

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2001-08-08  7:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <mailman.996733981.23626.linux-kernel2news@redhat.com>
2001-08-02 17:15 ` Persistent device numbers Pete Zaitcev
2001-08-02  6:30 Borsenkow Andrej
2001-08-02  9:50 ` Chris Wedgwood
2001-08-02 10:20 ` Christoph Hellwig
2001-08-02 17:06   ` Greg KH
2001-08-02 14:37 ` Alan Cox
2001-08-02 20:05   ` Kurt Garloff
2001-08-08  7:27   ` Borsenkow Andrej

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®