[Eisfair] [e1] udev sichere Zuordnung
Marcus Roeckrath
marcus.roeckrath at gmx.de
Fr Jun 8 16:30:04 CEST 2018
Hallo Detlef,
Detlef Paschke wrote:
> Ich überlege, als Identifikation für den Steckplatz den Vendor des
> Controller zu nehmen, da Modell oder ähnliches nicht angegeben sind.
> Wenn ich es richtig sehe ist das 0x1b21 und sollte doch immer Bestand
> haben auch wenn sich an der Hardware "davor" etwas ändern sollte?
> Falls jemand noch eine Idee hat, hier mal der Auszug von udevadm für die
> bewusste Platte.
>
> eisfair # udevadm info --query=all --attribute-walk --name=/dev/sdg1
>
> Udevadm info starts with the device specified by the devpath and then
> walks up the chain of parent devices. It prints for every device
> found, all possible attributes in the udev rules key format.
> A rule to match, can be composed by the attributes of the device
> and the attributes from one single parent device.
>
> looking at parent device
>
'/devices/pci0000:00/0000:00:02.0/0000:01:00.0/ata4/host6/target6:0:0/6:0:0:0/block/sdg/sdg1':
> KERNEL=="sdg1"
> SUBSYSTEM=="block"
> looking at parent device
>
'/devices/pci0000:00/0000:00:02.0/0000:01:00.0/ata4/host6/target6:0:0/6:0:0:0':
> ATTRS{vendor}=="ATA "
> looking at parent device
> '/devices/pci0000:00/0000:00:02.0/0000:01:00.0':
> ATTRS{vendor}=="0x1b21"
Die von dir gewünschten (auszuwertenden) Infos liegen in unterschiedlichen
Scopes. Wie man das in einer udev-Zeile korrekt auswertet, ist mir nicht
wirklich klar.
Für den mount-Befehl brauchst du das Device (sdg1) und für eben den Vendor
0x1b21; dazwischen gibt es auch noch einen anderen Vendor.
Keine Ahnung, ob wir dir hier helfen können, oder ob eine Anfrage bei
udev-Spezialisten eher angebracht wäre.
--
Gruss Marcus
Mehr Informationen über die Mailingliste Eisfair