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.

Way to find out, which HDD belongs to which SATA-Port?

Featured Replies

I found some Infos in my SysLog about ata1,2,3 and so on.

My Question is now if there is a way to find out which HDD belongs to which SATA-Port?

 

Thanks for your Help

It's not easy, but I believe that Tom has made it somewhat simpler than it used to be, at least according to an almost hidden note I found.  Try searching the syslog for the serial number of the drive, and I believe the first occurrence should include the ata number, if it has an ata number (some don't).  I started a wiki article on this, Drive Symbols, but it's not complete.

 

A related question, how do you find the physical location of the drive?  See the Server Layout plugin.

  • Author

Thanks for the Hint RobJ

The Server Layout Plugin is not needed cause i now which Drive is in which Bay - but i dont know to which SATA-Port they belong  ;)

 

EDIT: Ok  :) - got all infos over the log-file - every HDD is mentioned in the log with SN and ata-Nr.

Thanks again for your help  :D

if you have drive leds (I have Norco rack case) you can use the following script

 

from the cli it will beep and blink the drive led

 

Myk

 

 

#!/bin/bash 

export OMIT=0

[ ${DEBUG:=0} -gt 0 ] && set -x -v

declare -a DRIVES MODELS CHOICE
typeset -x DRIVES MODELS CHOICE CMDS

TMPFILE="/tmp/identify_drive.$$"

trap "rm -f ${TMPFILE}" EXIT HUP INT QUIT TERM

CMDS="quit"

# --------------------------------------------------------------------- #
# Function    : LOAD_DRIVES                                             #
# Description : Reads directory with ls parses and stores into array.   #
#               used later to retreive drive for printing details       #
# Parameters  : Nothing                                                 #
# Returns     : Nothing                                                 #
# Environment : DRIVES array, MODELS array                              #
# --------------------------------------------------------------------- #
load_drives()
{
    ls -l /dev/disk/by-id/ | egrep 'ata\-' > ${TMPFILE}

    # rwxrwxrwx 1 root root  9 Apr 20 08:04 ata-Hitachi_HTS722020K9SA00_071007DP0400DTG101HA -> ../../sdf
    # lrwxrwxrwx 1 root root 10 Apr 20 08:04 ata-Hitachi_HTS722020K9SA00_071007DP0400DTG101HA-part1 -> ../../sdf1
    # I know it's inefficient.
    # but piping mount into loop creates a subprocess
    # whereby the export inside the loop never gets
    # back to the parent.

    i=0
    while read PERMS LINKS OWNER GROUP XX MONTH DD HHMM MODEL LINKER DEV
    do
        # ${parameter:offset:length}
        NAME=${DEV:6:4}                 # Save Whole Drive
        DEV=${DEV:6:3}                  # Remove Partition #
        if [ ${DEV} != ${NAME} ]; then continue; fi
        for OMODEL in ${OMIT_MODELS[*]}
        do  length=${#OMODEL}
            if [ ${MODEL:0:$length} = ${OMODEL} ];then OMIT=1;fi
        done
        if [ ${OMIT:=0} -gt 0 ]
           then OMIT=0
                continue
        fi
        DRIVES[$i]="/dev/${DEV}"
        MODELS[$i]="${MODEL}"
        CHOICE[$i]="/dev/${DEV} ${MODEL}"
        ((i++))
    done  < ${TMPFILE}

    rm -f ${TMPFILE}

}


present_drives()
{
    PS3="identify> "
    select DRIVE in "${CHOICE[@]}" ${CMDS}
    do
        echo "DRIVE: $DRIVE, REPLY: ${REPLY}"
        if [ -z "${DRIVE}" -a ! -z "${REPLY}" ]
           then DRIVE="${REPLY}"
        fi
        if [ -z "${DRIVE}" ]
           then return
        fi
        case "${DRIVE}" in
        q*|Q* )  exit;;
        e*|e* )  exit;;
        *     )  set ${DRIVE}; identify $@; return;;
        esac
   done
}



identify()
{

  ID=$1
  [ ! -z "${2}" ] && ID="$ID ($2)"

  echo -e "Reading ${ID}"
  while ! read -n1 -t1
  do
    echo -e "\r\007press ANY key to stop: [+]: \c"
    dd if=$1 of=/dev/null bs=1025K count=10   skip=${SKIP} 2>/dev/null 
    read -n1 -t1 && break
    ((SKIP=SKIP+1000))

    echo -e "\r\007press ANY key to stop: [x]: \c"
    dd if=$1 of=/dev/null bs=1025K count=10   skip=${SKIP} 2>/dev/null
    read -n1 -t1 && break
    ((SKIP=SKIP+1000))

    echo -e "\r\007press ANY key to stop: [-]: \c"
    dd if=$1 of=/dev/null bs=1025K count=100  skip=${SKIP} 2>/dev/null
    # sleep 1
    ((SKIP=SKIP+10000))
  done
  echo -e "\nDone."
}


if [ ! -z "${1}" ]
   then identify $1
        exit
fi

while true
do load_drives 
   present_drives
done

EDIT: Ok  :) - got all infos over the log-file - every HDD is mentioned in the log with SN and ata-Nr.

Thanks again for your help  :D

 

We need to thank Tom for adding this method.  I believe the note said he had to patch a core module to get it to output the model and serial info.

  • Author

I dont have HDD-LEDs - My Disks are mounted in a Big-Tower with no Drive-Bays

Ok then - Thanks to Tom for this Mod. Good work!!!

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.