Je nachdem wann/wie ein SATA/SCSI Controller erkannt wird legt das den Devicenamen der Festplatte fest. Ich möchte die Namen mit Udev fest regeln. Ich dachte zum Endausbau des Systemes an 6 SATA (5 sind schon drinn) 3 IDE Platten (werden mittlerweile über libata angesprochen) und extern noch 6 SCSI Platten. Problem ich habe/bekomme mehrere Platten die Baugleich sind. Jetzt hatte ich die Idee das anhand der Seriennummern der Platten zu regeln. Nur mit udevinfo taucht die nicht auf. Hier ein Beispiel nach Modellnamen nur bei mehreren baugleichen Modellen für mich suboptimal
Code: Alles auswählen
SUBSYSTEM=="block", SUBSYSTEMS=="scsi", ATTRS{model}=="SAMSUNG HD401LJ", NAME="sda"
Code: Alles auswählen
bitch:/etc/udev/rules.d# udevinfo -a -p /sys/block/sde
Udevinfo 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 device '/block/sde':
KERNEL=="sde"
SUBSYSTEM=="block"
DRIVER==""
ATTR{range}=="16"
ATTR{ext_range}=="256"
ATTR{removable}=="0"
ATTR{ro}=="0"
ATTR{size}=="781420655"
ATTR{capability}=="52"
ATTR{stat}==" 12170 18798 585693 827699 7289 12185 163640 187793 0 110861 1016063"
looking at parent device '/devices/pci0000:00/0000:00:05.0/host4/target4:0:0/4:0:0:0':
KERNELS=="4:0:0:0"
SUBSYSTEMS=="scsi"
DRIVERS=="sd"
ATTRS{device_blocked}=="0"
ATTRS{type}=="0"
ATTRS{scsi_level}=="6"
ATTRS{vendor}=="ATA "
ATTRS{model}=="SAMSUNG HD401LJ "
ATTRS{rev}=="ZZ10"
ATTRS{state}=="running"
ATTRS{timeout}=="30"
ATTRS{iocounterbits}=="32"
ATTRS{iorequest_cnt}=="0x5393"
ATTRS{iodone_cnt}=="0x5385"
ATTRS{ioerr_cnt}=="0x12"
ATTRS{modalias}=="scsi:t-0x00"
ATTRS{evt_media_change}=="0"
ATTRS{queue_depth}=="31"
ATTRS{queue_type}=="simple"
looking at parent device '/devices/pci0000:00/0000:00:05.0/host4/target4:0:0':
KERNELS=="target4:0:0"
SUBSYSTEMS==""
DRIVERS==""
looking at parent device '/devices/pci0000:00/0000:00:05.0/host4':
KERNELS=="host4"
SUBSYSTEMS==""
DRIVERS==""
looking at parent device '/devices/pci0000:00/0000:00:05.0':
KERNELS=="0000:00:05.0"
SUBSYSTEMS=="pci"
DRIVERS=="sata_nv"
ATTRS{vendor}=="0x10de"
ATTRS{device}=="0x037f"
ATTRS{subsystem_vendor}=="0x1458"
ATTRS{subsystem_device}=="0xb002"
ATTRS{class}=="0x010185"
ATTRS{irq}=="20"
ATTRS{local_cpus}=="00000003"
ATTRS{local_cpulist}=="0-1"
ATTRS{modalias}=="pci:v000010DEd0000037Fsv00001458sd0000B002bc01sc01i85"
ATTRS{numa_node}=="0"
ATTRS{enable}=="1"
ATTRS{broken_parity_status}=="0"
ATTRS{msi_bus}==""
looking at parent device '/devices/pci0000:00':
KERNELS=="pci0000:00"
SUBSYSTEMS==""
DRIVERS==""
bitch:/etc/udev/rules.d#
Code: Alles auswählen
bitch:/etc/udev/rules.d# udevinfo -a -p /sys/block/sdf
Udevinfo 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 device '/block/sdf':
KERNEL=="sdf"
SUBSYSTEM=="block"
DRIVER==""
ATTR{range}=="16"
ATTR{ext_range}=="256"
ATTR{removable}=="0"
ATTR{ro}=="0"
ATTR{size}=="781420655"
ATTR{capability}=="52"
ATTR{stat}==" 376830 1338746 19775517 8349776 1121779 2297722 27631736 7109353 0 1867267 15503806"
looking at parent device '/devices/pci0000:00/0000:00:05.0/host5/target5:0:0/5:0:0:0':
KERNELS=="5:0:0:0"
SUBSYSTEMS=="scsi"
DRIVERS=="sd"
ATTRS{device_blocked}=="0"
ATTRS{type}=="0"
ATTRS{scsi_level}=="6"
ATTRS{vendor}=="ATA "
ATTRS{model}=="SAMSUNG HD401LJ "
ATTRS{rev}=="ZZ10"
ATTRS{state}=="running"
ATTRS{timeout}=="30"
ATTRS{iocounterbits}=="32"
ATTRS{iorequest_cnt}=="0x17c7c4"
ATTRS{iodone_cnt}=="0x17c794"
ATTRS{ioerr_cnt}=="0x12"
ATTRS{modalias}=="scsi:t-0x00"
ATTRS{evt_media_change}=="0"
ATTRS{queue_depth}=="31"
ATTRS{queue_type}=="simple"
looking at parent device '/devices/pci0000:00/0000:00:05.0/host5/target5:0:0':
KERNELS=="target5:0:0"
SUBSYSTEMS==""
DRIVERS==""
looking at parent device '/devices/pci0000:00/0000:00:05.0/host5':
KERNELS=="host5"
SUBSYSTEMS==""
DRIVERS==""
looking at parent device '/devices/pci0000:00/0000:00:05.0':
KERNELS=="0000:00:05.0"
SUBSYSTEMS=="pci"
DRIVERS=="sata_nv"
ATTRS{vendor}=="0x10de"
ATTRS{device}=="0x037f"
ATTRS{subsystem_vendor}=="0x1458"
ATTRS{subsystem_device}=="0xb002"
ATTRS{class}=="0x010185"
ATTRS{irq}=="20"
ATTRS{local_cpus}=="00000003"
ATTRS{local_cpulist}=="0-1"
ATTRS{modalias}=="pci:v000010DEd0000037Fsv00001458sd0000B002bc01sc01i85"
ATTRS{numa_node}=="0"
ATTRS{enable}=="1"
ATTRS{broken_parity_status}=="0"
ATTRS{msi_bus}==""
looking at parent device '/devices/pci0000:00':
KERNELS=="pci0000:00"
SUBSYSTEMS==""
DRIVERS==""
bitch:/etc/udev/rules.d#