3ware mapping to disk devices in Linux

This is a discussion on 3ware mapping to disk devices in Linux within the Storage forums, part of the Systems category; Hi there I am trying to map device files to drive serial numbers in Linux. The reason I am trying to do this is mainly because Linux can swap all ...

Go Back   Unix Linux Forum > Technologies & Tools > Systems > Storage

FixUnix.com - Unix Linux Forums

Unix Content Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 11-04-2008, 02:31 PM
Default 3ware mapping to disk devices in Linux

Hi there
I am trying to map device files to drive serial numbers in Linux.

The reason I am trying to do this is mainly because Linux can swap all
drive letters at every boot. Yes I know that I can use filesystem
labels, mdadm array disk numbers etc, but if a disk fails I want to know
exactly and reliably WHICH disk I have to replace (we are speaking about
a big disk server here), and I can do that if I can get to the serial
number. From the OS just the device name is given to me, not the
physical slot (and disk member number in the mdadm array but I would
prefer to go the serial number way if possible).
Also at RAID array creation (mdadm), in order to do the things well, I
need to know a reliable mapping of disk device file to physical slot.
With this server I cannot count on drive activity leds being present or
functional.

Most controllers are good, and with them I can use
smartctl -i /dev/sdX...

However I have various controllers, and one of them is a 3ware (possibly
more than one 3ware in the future)
3ware doesn't work with the command line above, nor with hdparm.

With 3ware the only way to make it work is:
smartctl -i -d 3ware,PORTNUMBER /dev/twaCONTROLLERNUMBER

The problem is that I don't know a way to map the /dev/sdX device to its
PORTNUMBER and CONTROLLERNUMBER in the 3ware, so I am stuck again.

Please help
Thank you
Reply With Quote
  #2  
Old 11-04-2008, 03:15 PM
Default Re: 3ware mapping to disk devices in Linux

On Tue, 04 Nov 2008 14:31:23 -0500, linuxnewbie1234 wrote:

> I am trying to map device files to drive serial numbers in Linux.


/sbin/udevadm info -q env -p /block/sda|grep SERIAL_SHORT
or
/lib/udev/ata_id /dev/sda

Regards, Dave Hodgins

--
Change nomail.afraid.org to ody.ca to reply by email.
(nomail.afraid.org has been set up specifically for
use in usenet. Feel free to use it yourself.)
Reply With Quote
  #3  
Old 11-05-2008, 10:17 AM
Default Re: 3ware mapping to disk devices in Linux

David W. Hodgins wrote:
> On Tue, 04 Nov 2008 14:31:23 -0500, linuxnewbie1234 wrote:
>
>> I am trying to map device files to drive serial numbers in Linux.

>
> /sbin/udevadm info -q env -p /block/sda|grep SERIAL_SHORT


Oh My Goodness
Thank you! This works on 3ware.
The serial number is slightly tweaked by 3ware but the numeric part does
contain the correct HD serial number.
The command does not get a proper serial number on the mobo-integrated
SAS controller (LSI 1068E)
On 3ware without |grep I seem to be able to also get the PCI slot and
the scsi-id hence probably I could determine the 3ware controller ID.

Now I have 5 commands, each one works on something but no-one works on
everything:

Works on integrated SAS and integrated SATA, not on 3ware:
hdparm -I /dev/sdX | grep -i serial

Works on integrated SATA only:
hdparm -i /dev/sdX | grep -i serial

Works on integrated SATA only:
smartctl -a /dev/sdX | grep -i serial

Works on integrated SATA and on 3ware:
/sbin/udevadm info -q all -p /block/sdX | grep ID_SERIAL_SHORT

Works on integrated SATA only:
/lib/udev/ata_id /dev/sdX

> or
> /lib/udev/ata_id /dev/sda


This one works on integrated SATA only, doesn't work on 3ware nor on
integrated SAS.


Thank you
Reply With Quote
Reply

Thread Tools


All times are GMT -5. The time now is 07:35 PM.

In an effort to better serve ads to our visitors, cookies are used on Fixunix.com. For more information, check out our Privacy Policy.

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Ad Management by RedTyger