running udev-103 the scsi_id truncates ATA drive model numbers by two hex digits when using ATA drives with the libata PATA drivers. ENV{ID_MODEL}=="WDC_WD400BB-00DEA0", SYMLINK+="sysdisk/dev-image" ^^^^^^^ matches with old ide drivers. ENV{ID_MODEL}=="WDC_WD400BB-00DE", SYMLINK+="sysdisk/dev-image" ^^^^^^^^^ this is required to match with the new libata PATA drivers. this is snipped from udevtest, with a libata PATA driver. run_program: '/lib/udev/scsi_id' (stdout) 'ID_MODEL=WDC_WD400BB-00DE' I have worked around it by duplicating and modifying my custom rules but this can be quite jarring when transitioning between the old and new ATA drivers. udev labeling without suprises is a key for a smooth migration. If more information is required let me know.
Looking into udev-104: ata_id.c contains (cut down): char model[41]; set_str(model, (char *) id.model, 40); printf("ID_MODEL=%s\n", model); The original struct id of type hd_driveid also has space for 40 chars. scsi_id.c contains on the other hand: static char model_str[64]; model = sysfs_attr_get_value(dev_scsi->devpath, "model"); set_str(model_str, model, sizeof(model_str)-1); printf("ID_MODEL=%s\n", model_str); So both should get around with more than 16 chars. Can you check what your sysfs contains by (using correct device-name): cat /sys/block/sda/device/model
> Can you check what your sysfs contains by (using correct device-name): > cat /sys/block/sda/device/model cat /sys/block/sda/device/model: WDC WD400BB-00DE
A couple more bits of info that may be useful. The two kernels I have tested with is a 2.6.18.4 (vanilla) with the old IDE driver. The PATA kernel is 2.6.19 mostly vanilla. Linux reforged 2.6.19 #2 PREEMPT Sun Jan 14 03:58:23 PST 2007 i686 AMD Athlon(tm) XP 3000+ AuthenticAMD GNU/Linux upon examining the dmesg output the truncation is uniform from device detection. [ 41.288284] pata_via 0000:00:0f.0: version 0.1.14 [ 41.300048] scsi0 : pata_via [ 41.941604] scsi1 : pata_via [ 42.115575] scsi 0:0:0:0: Direct-Access ATA WDC WD400BB-00DE 05.0 PQ : 0 ANSI: 5
(In reply to comment #2) > > Can you check what your sysfs contains by (using correct device-name): > > cat /sys/block/sda/device/model > > cat /sys/block/sda/device/model: > WDC WD400BB-00DE > As kernel delivers truncated model-attribute I cannot see how this is a bug in udev and not the kernel.
Created attachment 117231 [details, diff] diagnostic patch please apply this patch and attach full dmesg output after booting the patched kernel
Created attachment 117292 [details] pata output from 2.7.21-rc7 I applied the diagnostic patch to 2.6.21-rc7 or so. For the sake of honesty I have RSDL v46 patched in too. That should not affect this at all. If you want a clean upstream for output I will build a new one. The first line is "test" , this is because I needed to check the network connection ( a nc pipe ) before I transferred the dmesg output to the laptop. Let me know if you need anymore info, I was just to busy with some other kernel issues (not scheduler) to put this on my front-burner. I know someone else is going to get hit hard by this problem though.
just to reconfirm the issue. This is output from 2.6.21 from hdparm -i /dev/sda /dev/sda: Model=WDC WD400BB-00DEA0 SerialNo=WD-WMAD12027356 from udevinfo /sys/block/sda udevinfo --query=all --path /sys/block/sda P: /block/sda N: sda S: disk/by-id/scsi-SATA_WDC_WD400BB-00DWD-WMAD12027356 S: disk/by-path/pci-0000:00:0f.0-scsi-0:0:0:0 S: sysdisk/dev-image E: IN_HOTPLUG=1 E: ID_VENDOR=ATA E: ID_MODEL=WDC_WD400BB-00DE E: ID_REVISION=05.0 E: ID_SERIAL=SATA_WDC_WD400BB-00DWD-WMAD12027356 E: ID_SERIAL_SHORT=WD-WMAD12027356 E: ID_TYPE=disk E: ID_BUS=scsi E: ID_PATH=pci-0000:00:0f.0-scsi-0:0:0:0
Unfortunately this can't be fixed right now. libata emulates ATA devices as SCSI devices. The SCSI inquiry data format places a 16 byte limit on model number, whereas the ATA limit is longer. This will be fixed in the future when libata is made independent from SCSI, but this probably won't be any time soon. For now we'll have to live with it as a known deficiency. Sorry for any inconvenience...
That particular sysfs field will not be fixed but zzam has pointed out that udev has been modified to retrieve the information another way: https://bugzilla.novell.com/show_bug.cgi?id=255413 So, if you upgrade to udev-109 and linux 2.6.21, your links should be correct again. thanks zzam.