L
linuxnewbie1234
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
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