public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: David Haller <gentoo@dhaller.de>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] ata6: exception Emask 0x10 SAct 0x0 SErr 0x4000000 action 0xe frozen
Date: Thu, 1 Aug 2013 10:19:47 +0200	[thread overview]
Message-ID: <20130801081947.GA4828@grusum.endjinn.de> (raw)
In-Reply-To: <CAEH5T2Nk5TdH8yC-yEmxvxvNLxA16s2kwURPswsCFiMs6q27Kg@mail.gmail.com>

Hello,

On Wed, 31 Jul 2013, Paul Hartman wrote:
>http://serverfault.com/questions/244944/linux-ata-errors-translating-to-a-device-name

All flawed IMHO. My version (works with PATA too), possibly flawed too:

==== ~/bin/ataid_to_drive.sh ====
#!/bin/bash
oIFS="$IFS"
IFS=$'\n'
CTRLS=( $(/sbin/lspci | grep 'ATA\|IDE') )
IFS="$oIFS"
for arg; do
    if test -z "${arg/ata*}"; then
        arg="${arg/ata}"
    fi
    if test -z "${arg/*.*}"; then
        ata="${arg%.*}"
        subid="$(printf "%i" "${arg##*.}")"
    else
        ata="$arg"
    fi
    echo "ata${ata}${subid/*/.$(printf "%02i" $subid)} is:"
    for ctrl in ${CTRLS[@]%% *}; do
        idpath="/sys/bus/pci/devices/*${ctrl}/*/*/*/unique_id"
        grep "^${ata}$" $idpath 2>/dev/null
        host=$(grep "^${ata}$" $idpath 2>/dev/null | \
               sed 's@.*/host\([0-9A-Fa-f]\+\)/.*@\1@')
        if test -n "$host"; then
            dmesg | grep "\] s[dr] $host:0:$subid.*Attached"
        fi
    done
done
====

Usage samples:

$ ataid_to_drive.sh ata23.00
$ ataid_to_drive.sh ata23.01
$ ataid_to_drive.sh ata23
$ ataid_to_drive.sh 23.01
$ ataid_to_drive.sh 23.1
$ ataid_to_drive.sh 23
$ ataid_to_drive.sh $(seq 1 4)

So you can use c&p from dmest/syslog or enter the number(s) yourself.

HTH,
-dnh

-- 
This space intentionally left aligned.


  parent reply	other threads:[~2013-08-01 13:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-31 18:11 [gentoo-user] ata6: exception Emask 0x10 SAct 0x0 SErr 0x4000000 action 0xe frozen Thanasis
2013-07-31 19:06 ` Paul Hartman
2013-07-31 20:17   ` Thanasis
2013-07-31 22:10     ` Bruce Hill
2013-08-01  7:51       ` Thanasis
2013-08-01 14:06         ` Paul Hartman
2013-08-01 14:30         ` Bruce Hill
2013-08-01  8:19   ` David Haller [this message]
2013-07-31 19:09 ` Bruce Hill
2013-07-31 21:59 ` Paul Hartman
2013-08-01  7:37   ` Thanasis
2013-08-01 14:43     ` Bruce Hill
2013-08-01 18:52       ` Thanasis
2013-08-01 16:38     ` Volker Armin Hemmann
2013-08-01 18:58       ` Thanasis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130801081947.GA4828@grusum.endjinn.de \
    --to=gentoo@dhaller.de \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox