[CentOS] mdadm and drive identification?

Mon Sep 19 19:34:05 UTC 2011
David C. Miller <millerdc at fusion.gat.com>

I have a server that has 16 drives in it. They are connected to a 3ware 9650SE-16ML SATA RAID card. I have the card set to export all the drives as JBOD because I prefer Linux to do the reporting of drive and RAID health . I'm using mdadm to create a RAID6 with a hot spare. Doing this I can take the disks and put them on a completely different SATA controller/computer and still have the RAID intact. My problem is that I have no "for sure" way of matching a drive assigned to one of the /dev/sd[a-z]. Normally I could use a number of methods to match up what /dev/sd[a-z] is to a drives serial number. smartctl, hdparm, udevinfo, /dev/disk/by-uuid, or /dev/disk/by-id. However, the 3ware card obfuscates the drives from the OS and those methods don't work. The only way I know how to get a drives serial number is via the smartctl command like "smartctl -d 3ware,[0-15] -i /dev/twa0", but that does not tell me which sd[a-z] the drive is assigned to. Here is what I have tried.

Creating a single large partition with fdisk on each drive as linux autoraid to get a uuid. for some reason the OS assigns the same uuid and only one uuid to the last drive I partition from the 3ware card. Basically all drives on the 3ware card have the same uuid..

Using the /dev/disk/by-id/.  For some reason the 3ware card does not always assign the same id to a drive after a reboot. 

Is there another easy way I can positively ID a drive by serial number and the /dev/sd[a-z] that mdadm sees? 

Thanks.
David.