April 14, 201313 yr Is there a way to see which drive is attached to which SATA controller from the web interface or from the cli? I find that this would be very useful information, so I don't have to open the case and trace back cables.
April 15, 201313 yr You can look at the system log, and read through it to determine which drive is on which controller and port... but it really much faster and easier to just open the computer and trace the cables. Also even if you know the logical address of the port on a controller, the port numbers do not always match what is printed on the PCB... Even after opening the computer, you may also still need to remove the hard drives to see the Serial number of each drive to figure out which one is which, unless you have already put a quick identification mark on each drive like was suggested with the last four digits of the S./N on each drive.
April 15, 201313 yr Wouldn't it be even quicker just to check once then write it down in a lastpass note or email it to yourself or something along those lines?
April 16, 201313 yr Wouldn't it be even quicker just to check once then write it down in a lastpass note or email it to yourself or something along those lines? The ata numbers will not change but the sd* device labels will.
April 16, 201313 yr Wouldn't it be even quicker just to check once then write it down in a lastpass note or email it to yourself or something along those lines? The ata numbers will not change but the sd* device labels will. #!/bin/bash allDisks=$(sudo fdisk -l | grep "Disk /dev/" | sed 's/Disk \(\/dev\/sd\w\): .*/\1/') for disk in $allDisks do sudo hdparm -i $disk | grep "Model=" done That took ~ 30 minutes to make, holy crap does nobody explain "sed" very well on the internet. Literally all they needed to say was mode/regex/output/flags. I hate being new to linux EDIT:- Output:- Model=Samsung SSD 840 Series, FwRev=DXT06B0Q, SerialNo=XXX Model=WDC WD30EFRX-68AX9N0, FwRev=80.00A80, SerialNo=WD-XXX Model=WDC WD30EFRX-68AX9N0, FwRev=80.00A80, SerialNo=WD-XXX Model=WDC WD30EFRX-68AX9N0, FwRev=80.00A80, SerialNo=WD-XXX Model=WDC WD30EFRX-68AX9N0, FwRev=80.00A80, SerialNo=WD-XXX Model=WDC WD30EFRX-68AX9N0, FwRev=80.00A80, SerialNo=WD-XXX Blocked the serial numbers just because I have no idea how far into the register/warranty process you can go with them and I don't really want to RMA them later to realize they're registered to someone else's account or something. But yeah, there you go, you can match SD* to the model number. Tuh-duh, now just write the model number down to what it's connected to.
April 17, 201313 yr Wouldn't it be even quicker just to check once then write it down in a lastpass note or email it to yourself or something along those lines? The ata numbers will not change but the sd* device labels will. #!/bin/bash allDisks=$(sudo fdisk -l | grep "Disk /dev/" | sed 's/Disk \(\/dev\/sd\w\): .*/\1/') for disk in $allDisks do sudo hdparm -i $disk | grep "Model=" done That took ~ 30 minutes to make, holy crap does nobody explain "sed" very well on the internet. Literally all they needed to say was mode/regex/output/flags. I hate being new to linux EDIT:- Output:- Model=Samsung SSD 840 Series, FwRev=DXT06B0Q, SerialNo=XXX Model=WDC WD30EFRX-68AX9N0, FwRev=80.00A80, SerialNo=WD-XXX Model=WDC WD30EFRX-68AX9N0, FwRev=80.00A80, SerialNo=WD-XXX Model=WDC WD30EFRX-68AX9N0, FwRev=80.00A80, SerialNo=WD-XXX Model=WDC WD30EFRX-68AX9N0, FwRev=80.00A80, SerialNo=WD-XXX Model=WDC WD30EFRX-68AX9N0, FwRev=80.00A80, SerialNo=WD-XXX Blocked the serial numbers just because I have no idea how far into the register/warranty process you can go with them and I don't really want to RMA them later to realize they're registered to someone else's account or something. But yeah, there you go, you can match SD* to the model number. Tuh-duh, now just write the model number down to what it's connected to. How does this provide mapping from /dev/sd* label to SN? The device labels may change on every boot so writing them down is not useful.
April 18, 201313 yr ok, IF you can determine which bus each controller is on and which port of each controller the drives are on from the information as seen by the computer this may work for you... WITH THE DRIVES MOUNTED AND ARRAY ON-LINE... in 4.5.x (and probably other 4.x versions): simply go to the DEVICES tab on the unRAID web GUI interface... under Disk devices - the drives in the array (including the cache drive in this instance) will be listed in array order. For each drive you will see; 1. The PCI bus assignment - each controller will have its own address assignment. This MAY change with hardware changes, and BIOS hardware mapping... 2. The SCSI logical address - each drive will be connected to its own port on a controller. This SHOULD remain the same as long as a drive cable is always on the same port. 3. Host number and sd_ assignment - This is assigned on boot by the kernel. This one changes the most and is basically dynamically allocated. 4. Drive model and serial number as reported by the drive... This does not seem to be available on 5.x, (at least I can not find the equivalent in 5RC8a) You should be able to find the information by digging through the system log however... Yes, I have found this information very useful when testing various controllers and checking for performance and compatibility and stability. just makes it a little quicker to see some things when there are questions...
April 18, 201313 yr Wouldn't it be even quicker just to check once then write it down in a lastpass note or email it to yourself or something along those lines? The ata numbers will not change but the sd* device labels will. #!/bin/bash allDisks=$(sudo fdisk -l | grep "Disk /dev/" | sed 's/Disk \(\/dev\/sd\w\): .*/\1/') for disk in $allDisks do sudo hdparm -i $disk | grep "Model=" done That took ~ 30 minutes to make, holy crap does nobody explain "sed" very well on the internet. Literally all they needed to say was mode/regex/output/flags. I hate being new to linux EDIT:- Output:- Model=Samsung SSD 840 Series, FwRev=DXT06B0Q, SerialNo=XXX Model=WDC WD30EFRX-68AX9N0, FwRev=80.00A80, SerialNo=WD-XXX Model=WDC WD30EFRX-68AX9N0, FwRev=80.00A80, SerialNo=WD-XXX Model=WDC WD30EFRX-68AX9N0, FwRev=80.00A80, SerialNo=WD-XXX Model=WDC WD30EFRX-68AX9N0, FwRev=80.00A80, SerialNo=WD-XXX Model=WDC WD30EFRX-68AX9N0, FwRev=80.00A80, SerialNo=WD-XXX Blocked the serial numbers just because I have no idea how far into the register/warranty process you can go with them and I don't really want to RMA them later to realize they're registered to someone else's account or something. But yeah, there you go, you can match SD* to the model number. Tuh-duh, now just write the model number down to what it's connected to. How does this provide mapping from /dev/sd* label to SN? The device labels may change on every boot so writing them down is not useful. Unless I'm completely misunderstanding the question, OP is asking how to tell which hard-drive is linked up to which raid card. What I'm suggesting is OP opens his case, writes down which model & serial numbers are connected to which raid card. Whenever OP wants to know which software based name (SDA, SDB, SDC, SDD) links up to which drive (Western Digital WD30EFRX-68AX9N0 WD-ABCDEFGH) he runs the above script, modified slightly so it outputs something like this:- /dev/sdb Model=Samsung SSD 840 Series, FwRev=DXT06B0Q, SerialNo=XXX /dev/sda Model=WDC WD30EFRX-68AX9N0, FwRev=80.00A80, SerialNo=WD-XXX /dev/sdc Model=WDC WD30EFRX-68AX9N0, FwRev=80.00A80, SerialNo=WD-XXX /dev/sdd Model=WDC WD30EFRX-68AX9N0, FwRev=80.00A80, SerialNo=WD-XXX /dev/sdf Model=WDC WD30EFRX-68AX9N0, FwRev=80.00A80, SerialNo=WD-XXX /dev/sde Model=WDC WD30EFRX-68AX9N0, FwRev=80.00A80, SerialNo=WD-XXX And then he matches up the /dev/sd* with the model number and checks his old notes to see which raid card it's connected to. EDIT:- Updated the script for you, since, I'm bored. New output:- /dev/sdb - Model=Samsung SSD 840 Series, FwRev=DXT06B0Q, SerialNo=xxx /dev/sdc - Model=WDC WD30EFRX-68AX9N0, FwRev=80.00A80, SerialNo=WD-xxx /dev/sdd - Model=WDC WD30EFRX-68AX9N0, FwRev=80.00A80, SerialNo=WD-xxx /dev/sde - Model=WDC WD30EFRX-68AX9N0, FwRev=80.00A80, SerialNo=WD-xxx /dev/sdf - Model=WDC WD30EFRX-68AX9N0, FwRev=80.00A80, SerialNo=WD-xxx /dev/sda - Model=WDC WD30EFRX-68AX9N0, FwRev=80.00A80, SerialNo=WD-xxx Obviously the serial numbers are unique (Or this would be useless), however, I replaced them with XXX. #!/bin/bash allDisks=$(sudo fdisk -l | grep "Disk /dev/" | sed 's/Disk \(\/dev\/sd\w\): .*/\1/') for disk in $allDisks do echo -n "$disk - " sudo hdparm -i $disk | grep "Model=" done This one logs the /dev/sd* location along with the information of the drive. You write down the disk information, that data never changes unless the physical disk changes, in which case you just have to update your notes (E.G. if you RMA a drive/etc).
Archived
This topic is now archived and is closed to further replies.