View previous topic :: View next topic |
Author |
Message |
nkalle n00b
Joined: 23 Aug 2004 Posts: 59
|
Posted: Wed Jul 26, 2006 12:47 pm Post subject: udev Problem |
|
|
Hi everyone.
I have a Problem with udev I cannot solve.
I'm currently testing sata-hotplug with the Patch from tejun heo (http://home-tj.org/wiki/index.php/Libata-tj-stable) on kernel 2.6.17.4....
This Patch works great as I can plug sata-disks in and out and everything is getting recognized as it should be.
The Problem is:
when I plug out the (e.g) sda drive and plug it in again it is getting recognized as sdc...
I want to use this for softwareraid and would like mdadm to rebuild the md-device automatically when the disk is changed.
If the disk would be recognized as /dev/sda again this would be no problem, so I thought about udev and set up the following rules:
SYSFS{model}=="ST3250823AS", ID=="2:0:0:0", BUS=="scsi", NAME="sdb"
SYSFS{model}=="ST3250823AS", ID=="1:0:0:0", BUS=="scsi", NAME="sda"
but it isn't working...
maybe someone has got an hint for me?
Best Regards |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54311 Location: 56N 3W
|
Posted: Wed Jul 26, 2006 12:53 pm Post subject: |
|
|
nkalle,
Use the drive serial numbers in your udev rules. e.g Code: | product}=="DatawriteVoyager", SYSFS{manufacturer}=="Pendrive", SYSFS{serial}=="173426667658" NAME="pendrive" | names my FLASH stick, which reports a specific serial number.
If you want to be able to use several drives as /dev/sda you will need a rule each.
[edit: the rule must be one long line - its been wrapped here, in the post] _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
nkalle n00b
Joined: 23 Aug 2004 Posts: 59
|
Posted: Wed Jul 26, 2006 1:02 pm Post subject: |
|
|
Thanks for your reply but unfortunately there is no serial number...
this is what udevinfo gives me:
looking at device '/block/sda':
KERNEL=="sda"
SUBSYSTEM=="block"
SYSFS{stat}==" 18946 244 249876 45480 5706 103 86266 59628 0 81256 105108"
SYSFS{size}=="488397168"
SYSFS{removable}=="0"
SYSFS{range}=="16"
SYSFS{dev}=="8:0"
looking at device '/devices/pci0000:00/0000:00:07.0/host2/target2:0:0/2:0:0:0':
ID=="2:0:0:0"
BUS=="scsi"
DRIVER=="sd"
SYSFS{ioerr_cnt}=="0x0"
SYSFS{iodone_cnt}=="0x7955"
SYSFS{iorequest_cnt}=="0x7955"
SYSFS{iocounterbits}=="32"
SYSFS{timeout}=="30"
SYSFS{state}=="running"
SYSFS{rev}=="3.03"
SYSFS{model}=="ST3250823AS "
SYSFS{vendor}=="ATA "
SYSFS{scsi_level}=="6"
SYSFS{type}=="0"
SYSFS{queue_type}=="none"
SYSFS{queue_depth}=="1"
SYSFS{device_blocked}=="0"
looking at device '/devices/pci0000:00/0000:00:07.0/host2/target2:0:0':
ID=="target2:0:0"
BUS==""
DRIVER==""
looking at device '/devices/pci0000:00/0000:00:07.0/host2':
ID=="host2"
BUS==""
DRIVER==""
looking at device '/devices/pci0000:00/0000:00:07.0':
ID=="0000:00:07.0"
BUS=="pci"
DRIVER=="sata_nv"
SYSFS{modalias}=="pci:v000010DEd00000054sv000010F1sd00002865bc01sc04i85"
SYSFS{local_cpus}=="ff"
SYSFS{irq}=="18"
SYSFS{class}=="0x010485"
SYSFS{subsystem_device}=="0x2865"
SYSFS{subsystem_vendor}=="0x10f1"
SYSFS{device}=="0x0054"
SYSFS{vendor}=="0x10de"
looking at device '/devices/pci0000:00':
ID=="pci0000:00"
BUS==""
DRIVER==""
I really don't see anything outstanding but the model...
Best regards |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54311 Location: 56N 3W
|
Posted: Wed Jul 26, 2006 2:09 pm Post subject: |
|
|
nkalle,
Read this guide to udev rules.
You need some field (or combination) in /sys that can be used to uniquely identify the drives. Then you can use it in your rules. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
|