Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Map Drive to Sata Controller

Featured Replies

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.

Short answer. No.

 

Sent from my SGH-I727R using Tapatalk 2

 

 

  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.

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?

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.

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.

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.

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...

 

 

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.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.