LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 05-23-2011, 06:15 AM   #1
MasterOfTheWind
Member
 
Registered: Jul 2004
Distribution: Arch, Debian sid, Kubuntu, Slackware 11
Posts: 324

Rep: Reputation: 30
Find device name for "ata5"


Hi there!

This is probably a horrendously stupid question, but I need to find what device "ata5" is on my computer.

When booting my box today I noticed the following message in the dmesg log:

Code:
ata5: softreset failed (timeout)
Not sure what this is all about, but I would very much like to find which disk this message relates to - however, for the life of me I can't find out which block device it is.

Can anyone help me out?
 
Old 05-23-2011, 11:53 AM   #2
cascade9
Senior Member
 
Registered: Mar 2011
Location: Brisneyland
Distribution: Debian, aptosid
Posts: 3,718

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
ATA-5 would be your HDD. (ATA-5 = Ultra DMA 3, 4 or UDMA66 or Ultra ATA/66)
 
Old 05-23-2011, 11:56 AM   #3
serafean
Member
 
Registered: Mar 2006
Location: Czech Republic
Distribution: Gentoo, Chakra
Posts: 871
Blog Entries: 9

Rep: Reputation: 103Reputation: 103
Hi,

I used "dmesg | grep ata2" a couple days ago to figure out which HDD was on SATA 1. The relevant ouput was :
Code:
ata1.00: ATA-8: WDC WD3200BEVT-22ZCT0, 11.01A11, max UDMA/133
I thus knew it was my 320GB Western Digital. Another option would be to check which disk is connected to which port, but that can usually be overriden in the BIOS, so not necessarily correct.

Serafean
 
Old 05-23-2011, 12:13 PM   #4
amani
Senior Member
 
Registered: Jul 2006
Location: Kolkata, India
Distribution: 64-bit GNU/Linux, Kubuntu64, Fedora QA, Slackware,
Posts: 2,758

Rep: Reputation: Disabled
don't bother about the message "ata5: softreset failed (timeout)".

if there is nothing more in the next line
 
Old 05-23-2011, 12:15 PM   #5
MasterOfTheWind
Member
 
Registered: Jul 2004
Distribution: Arch, Debian sid, Kubuntu, Slackware 11
Posts: 324

Original Poster
Rep: Reputation: 30
Thank you both for your replies, however I am still stuck.

1) First of all, I have a total of 6 hard drives in my box. I know that the message refers to an attached hdd, my problem is finding out which one it is.

2) The major problem is that "ata5" is never mentioned in dmesg besides the following lines:

Code:
ata5: SATA max UDMA/100 host m128@0xe9004000 port 0xe9000000 irq 17

...snip...

ata5: softreset failed (timeout)
ata5: softreset failed (timeout)
ata5: softreset failed (timeout)
ata5: limiting SATA link speed to 1.5 Gbps
ata5: softreset failed (timeout)
ata5: reset failed, giving up
... and this does not give me any info on what ata5 refers to. Furthermore - all of my hard drives appear to be working fine. So I am at a loss here - no idea what's going on :S
 
Old 05-23-2011, 12:18 PM   #6
MasterOfTheWind
Member
 
Registered: Jul 2004
Distribution: Arch, Debian sid, Kubuntu, Slackware 11
Posts: 324

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by amani View Post
don't bother about the message "ata5: softreset failed (timeout)".

if there is nothing more in the next line
OK, thanks... however, it slows down the booting process rather considerably.

Do you know why this error message is shown? I guess it might be the kernel config or perhaps RAID-related; but I haven't updated my kernel prior to this occurring, neither do I have a RAID set up.
 
Old 05-23-2011, 12:40 PM   #7
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,147

Rep: Reputation: 330Reputation: 330Reputation: 330Reputation: 330
Look in /var/log/messages for ATA5. (E.g: grep -i ata5 /var/log/messages or just search for all ATA references in there.)

(I'd show you an example, but I'm on an XP system right now . . .)
 
Old 05-23-2011, 12:49 PM   #8
MasterOfTheWind
Member
 
Registered: Jul 2004
Distribution: Arch, Debian sid, Kubuntu, Slackware 11
Posts: 324

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by PTrenholme View Post
Look in /var/log/messages for ATA5.
Thank you for your suggestion. The messages log contains a number of following lines repeatedly logged every 7 minutes or so:

Code:
ata5: hard resetting link
ata5: hard resetting link
ata5: hard resetting link
ata5: SATA link up 3.0 Gbps (SStatus 123 SControl 0)
ata5.00: configured for UDMA/100
ata5: EH complete
So still nothing...
 
Old 05-23-2011, 01:47 PM   #9
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,147

Rep: Reputation: 330Reputation: 330Reputation: 330Reputation: 330
Ah, well, look where the messages start, where you should see something like this (where the ID is in bold-face type):
Code:
May 23 13:43:19 Trenholme kernel: [    3.651671] ata3: PATA max UDMA/100 cmd 0xa400 ctl 0xa800 bmdma 0xb400 irq 17
May 23 13:43:19 Trenholme kernel: [    3.850558] ata3.00: ATAPI: DVD-RW IDE1004, VER 0045, max UDMA/66
May 23 13:43:19 Trenholme kernel: [    3.850856] ata3.01: ATA-7: Maxtor 6Y250P0, YAR41BW0, max UDMA/133
May 23 13:43:19 Trenholme kernel: [    3.850865] ata3.01: 490234752 sectors, multi 16: LBA48 
May 23 13:43:19 Trenholme kernel: [    3.858193] ata3.00: configured for UDMA/66
May 23 13:43:19 Trenholme kernel: [    3.865846] ata3.01: configured for UDMA/100
May 23 13:43:19 Trenholme kernel: [    4.039718] ata3.01: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6
May 23 13:43:19 Trenholme kernel: [    4.039778] ata3.01: BMDMA stat 0x14
May 23 13:43:19 Trenholme kernel: [    4.039826] ata3.01: failed command: READ DMA EXT
May 23 13:43:19 Trenholme kernel: [    4.039880] ata3.01: cmd 25/00:08:98:a7:ac/00:00:14:00:00/f0 tag 0 dma 4096 in
May 23 13:43:19 Trenholme kernel: [    4.040091] ata3.01: status: { DRDY ERR }
May 23 13:43:19 Trenholme kernel: [    4.040143] ata3.01: error: { ICRC ABRT }
May 23 13:43:19 Trenholme kernel: [    4.040224] ata3: soft resetting link
That is, my "bad" disk is a type ATA-7 Maxtor HD, serial number 6Y259P0. (In my case, that drive is in an old "hot swap" box that mangles newer ATA commands, so I see this stuff every time I boot the system. I'm going to replace the hot-swap box when I can afford it, so it won't be soon.)

<edit>
By the way, note the line preceding the one I highlighted. That tells me that my problem drive is the "slave" drive (ATA3.01) on the third PATA cable, where my DVD drive is in the "master" slot (ATA3.00) of that cable. So your ATA5.00 drive should be in the "master" slot of your fifth drive cable. (If you have SATA cables, that might be your fifth drive. My system is a decade old, and SATA drives weren't available when I built it.)
</edit>

Last edited by PTrenholme; 05-23-2011 at 01:59 PM.
 
Old 05-23-2011, 02:04 PM   #10
MasterOfTheWind
Member
 
Registered: Jul 2004
Distribution: Arch, Debian sid, Kubuntu, Slackware 11
Posts: 324

Original Poster
Rep: Reputation: 30
Ladies and gents, I have been able to pin down the problem. After what I can see my backup drive has silently died. It stays unmounted by default - that is why I had the impression that all drives are working.

@PTrenholme: Nope, nothing. The only thing I did with the snippet from my messages log was to trim off the beginning of the line - indicating date and hostname (for safety reasons). I know it is very strange that no identifiers were printed anywhere - but that is perhaps because the hdd is so kaput that it is unable to identify itself properly? Otherwise I do not have any good explanation for this behavior - all my other hard drives identify themselves correctly.
 
Old 05-23-2011, 02:15 PM   #11
MasterOfTheWind
Member
 
Registered: Jul 2004
Distribution: Arch, Debian sid, Kubuntu, Slackware 11
Posts: 324

Original Poster
Rep: Reputation: 30
Everyone, thanks for the help! It's really appreciated!
 
Old 02-05-2013, 01:10 AM   #12
ectospasm
LQ Newbie
 
Registered: Oct 2010
Posts: 4

Rep: Reputation: 3
Script to determine ataN...

This script will only work if you've booted relatively recently (and it's geared towards Debian; it writes the ataN information to /var/log/kern.log). If you have logrotate enabled there's a chance the relevant information has been rotated out, so be wary. You might have to change kern.log to messages depending on your distro of choice. As I said this works for me on Debian sid (or would have, if the relevant bits hadn't been rotated into oblivion ;-):

Code:
#!/bin/bash                                                                                   
                                                                                              
# 1. Get current uptime                                                                       
uptime=$(uptime | awk -F' '  '{ print $3" "$4 }' | sed s/,//)                                 
                                                                                              
# 2. calculate boot date from uptime                                                          
date=$(date -d "$uptime ago" | awk '{print $2" "$3 }')                                        
                                                                                              
# Once we have the first two above, set up a rather elaborate pipeline                        
# 3.  Find info from boot date in kern.log (even gzipped, hence the zgrep)                    
# 4.  Find the ata relevant bits                                                              
# 5.  Strip out the extra stuff we don't need (first sed)                                     
# 6.  sort and strip out more stuff we don't need                                             
# 7.  Print out a list of ataN controller devices mapped to /dev devices (e.g. hda, sdb, etc.)        
zgrep "$date"  /var/log/kern.log*  | \                                                        
grep 'ata[0-9]\+.[0-9][0-9]: ATA'  | \                                                        
sed 's/^.*\] ata//' | \                                                                       
sort -n | sed 's/:.*//' | \                                                                   
awk ' { a="ata" $1; printf("%10s is /dev/sd%c\n", a, 96+NR); }'
That should give you output similar to the following:
Code:
ata1 is /dev/hda
ata3 is /dev/sda
ata4 is /dev/sdb
ata5 is /dev/sdc
Your output will differ, possibly greatly depending on how many ATA devices you have connected, and on the particular hardware controller specifics (firmware, kernel driver, etc.). Alas, this script isn't currently working for me because my uptime is roughly 31 days, and goes back to Jan 5. The earliest time I have in any of my kern.log files is Jan 6. Go figure.
 
Old 02-05-2013, 09:25 PM   #13
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,147

Rep: Reputation: 330Reputation: 330Reputation: 330Reputation: 330
This is a rather old thread, but, for what it's worth, most modern distributions using udev will have this command:
Code:
$ ls -l /dev/disk/by-id | sort -k 11
total 0
lrwxrwxrwx. 1 root root 11 Feb  5 19:03 md-name-HP-p6710f:127 -> ../../md126
lrwxrwxrwx. 1 root root 11 Feb  5 19:03 md-uuid-31ae217a:e7564465:9e527f40:40dcd2b8 -> ../../md126
lrwxrwxrwx. 1 root root  9 Feb  5 19:03 ata-ST31000528AS_6VPBQVS7 -> ../../sda
lrwxrwxrwx. 1 root root  9 Feb  5 19:03 wwn-0x5000c50032d81e7f -> ../../sda
lrwxrwxrwx. 1 root root 10 Feb  5 19:03 ata-ST31000528AS_6VPBQVS7-part1 -> ../../sda1
lrwxrwxrwx. 1 root root 10 Feb  5 19:03 wwn-0x5000c50032d81e7f-part1 -> ../../sda1
lrwxrwxrwx. 1 root root 10 Feb  5 19:04 ata-ST31000528AS_6VPBQVS7-part2 -> ../../sda2
lrwxrwxrwx. 1 root root 10 Feb  5 19:04 wwn-0x5000c50032d81e7f-part2 -> ../../sda2
lrwxrwxrwx. 1 root root 10 Feb  5 19:03 ata-ST31000528AS_6VPBQVS7-part3 -> ../../sda3
lrwxrwxrwx. 1 root root 10 Feb  5 19:03 wwn-0x5000c50032d81e7f-part3 -> ../../sda3
lrwxrwxrwx. 1 root root 10 Feb  5 19:03 ata-ST31000528AS_6VPBQVS7-part4 -> ../../sda4
lrwxrwxrwx. 1 root root 10 Feb  5 19:03 wwn-0x5000c50032d81e7f-part4 -> ../../sda4
lrwxrwxrwx. 1 root root 10 Feb  5 19:03 ata-ST31000528AS_6VPBQVS7-part5 -> ../../sda5
lrwxrwxrwx. 1 root root 10 Feb  5 19:03 wwn-0x5000c50032d81e7f-part5 -> ../../sda5
lrwxrwxrwx. 1 root root  9 Feb  5 19:03 ata-ST2000DL003-9VT166_5YD3C2FZ -> ../../sdb
lrwxrwxrwx. 1 root root  9 Feb  5 19:03 wwn-0x5000c500385662bf -> ../../sdb
lrwxrwxrwx. 1 root root 10 Feb  5 19:04 ata-ST2000DL003-9VT166_5YD3C2FZ-part1 -> ../../sdb1
lrwxrwxrwx. 1 root root 10 Feb  5 19:04 wwn-0x5000c500385662bf-part1 -> ../../sdb1
lrwxrwxrwx. 1 root root 10 Feb  5 19:03 ata-ST2000DL003-9VT166_5YD3C2FZ-part2 -> ../../sdb2
lrwxrwxrwx. 1 root root 10 Feb  5 19:03 wwn-0x5000c500385662bf-part2 -> ../../sdb2
lrwxrwxrwx. 1 root root 10 Feb  5 19:03 ata-ST2000DL003-9VT166_5YD3C2FZ-part3 -> ../../sdb3
lrwxrwxrwx. 1 root root 10 Feb  5 19:03 wwn-0x5000c500385662bf-part3 -> ../../sdb3
lrwxrwxrwx. 1 root root  9 Feb  5 19:03 ata-WDC_WD20EARX-00PASB0_WD-WMAZA8382941 -> ../../sdc
lrwxrwxrwx. 1 root root  9 Feb  5 19:03 wwn-0x50014ee25c328225 -> ../../sdc
lrwxrwxrwx. 1 root root 10 Feb  5 19:04 ata-WDC_WD20EARX-00PASB0_WD-WMAZA8382941-part1 -> ../../sdc1
lrwxrwxrwx. 1 root root 10 Feb  5 19:04 wwn-0x50014ee25c328225-part1 -> ../../sdc1
lrwxrwxrwx. 1 root root 10 Feb  5 19:03 ata-WDC_WD20EARX-00PASB0_WD-WMAZA8382941-part2 -> ../../sdc2
lrwxrwxrwx. 1 root root 10 Feb  5 19:03 wwn-0x50014ee25c328225-part2 -> ../../sdc2
lrwxrwxrwx. 1 root root  9 Feb  5 19:03 usb-Generic-_SD_MMC_18E391066476-0:0 -> ../../sdd
lrwxrwxrwx. 1 root root  9 Feb  5 19:03 usb-Generic-_Compact_Flash_18E391066476-0:1 -> ../../sde
lrwxrwxrwx. 1 root root  9 Feb  5 19:03 usb-Generic-_SM_xD-Picture_18E391066476-0:2 -> ../../sdf
lrwxrwxrwx. 1 root root  9 Feb  5 19:03 usb-Generic-_MS_MS-Pro_18E391066476-0:3 -> ../../sdg
lrwxrwxrwx. 1 root root  9 Feb  5 19:03 ata-hp_DVD_A_DH16ABLH_3L8108904593 -> ../../sr0
available. Of course, if - as the OP reported - your dive is inoperative to the point that the drirve is not available to the kernel, the kernel can tell you nothing about it.

Last edited by PTrenholme; 02-05-2013 at 09:28 PM.
 
Old 02-06-2013, 03:25 AM   #14
ectospasm
LQ Newbie
 
Registered: Oct 2010
Posts: 4

Rep: Reputation: 3
Quote:
Originally Posted by PTrenholme View Post
This is a rather old thread, but, for what it's worth, most modern distributions using udev will have this command:$ ls -l /dev/disk/by-id | sort -k 11...available. Of course, if - as the OP reported - your dive is inoperative to the point that the drirve is not available to the kernel, the kernel can tell you nothing about it.
But that still doesn't tell you what 'ata5' is... It just shows the ID of the disk if the kernel sees it. If it's in the log my method should find it, even if the kernel doesn't presently see the device.
 
Old 02-06-2014, 04:31 AM   #15
affinityvision
LQ Newbie
 
Registered: Oct 2010
Posts: 2

Rep: Reputation: 0
Here's my script, based on a couple of posts above (this for current 7.3 Debian)
Code:
#!/bin/bash

# Show disk model/serial numbers
#
(
cd /dev/disk/by-id/
# ata
echo "ATA:"
ls -l ata* | sort -k 11|grep [a-z]$|awk '{print "\t"substr($NF,7,3)"\t"substr($9,5)}'
echo

# SCSI does not seem to add anything useful...
# scsi
#echo "SCSI:"
#ls -l scsi* | sort -k 11|grep [a-z]$|awk '{print "\t"substr($NF,7,3)"\t"substr($9,6)}'
#echo

# wwn
echo "WWN:"
ls -l wwn* | sort -k 11|grep [a-z]$|awk '{print "\t"substr($NF,7,3)"\t"substr($9,5)}'
echo
)


# 1. Get current uptime
uptime=$(uptime | awk -F' '  '{ print $3" "$4 }' | sed s/,//)
echo "Uptime: $uptime"

# 2. calculate boot date from uptime
date=""
date=$(date -d "$uptime ago" 2>/dev/null | awk '{print substr($3,1,3)" "$2 }')
# if the above assignment of date fails, then let's work it out from the
# current /var/log/kern.log file (uptime doesn't have a number of days...)
if [ -z $date ];
then
        date=$(grep "log source = /proc/kmsg started.$" /var/log/kern.log)
        date=${date:0:6}
fi

read -r aaaa bbbb <<< $(echo $date)
if [ ${#bbbb} -eq 1 ];then date="$aaaa  $bbbb";fi
echo "Date: \"$date\""
echo

kernfile=$(zgrep -l "^${date}.*log source = /proc/kmsg started.$" /var/log/kern.log*)
echo $kernfile
echo

aaa=$(zgrep "log source = /proc/kmsg started.$" $kernfile|tail -1);aaa=${aaa:0:10}


echo "NB: The following information is from BOOT time, it could be wrong now...."
echo
# Once we have the first two above, set up a rather elaborate pipeline
# 3.  Find info from boot date in kern.log (even gzipped, hence the zgrep)
# 4.  Find the ata relevant bits
# 5.  Strip out the extra stuff we don't need (first sed)
# 6.  sort and strip out more stuff we don't need
# 7.  Print out a list of ataN controller devices mapped to /dev devices (e.g. hda, sdb, etc.)
zgrep "^$aaa"  $kernfile  | \
grep 'ata[0-9]\+.[0-9][0-9]: ATA'  | \
sed 's/^.*\] ata//' | \
sort -n | sed 's/:.*//' | \
awk ' { a="ata" $1; printf("%10s is /dev/sd%c\n", a, 96+NR); }'
Edit: slight adjustment, if the machine was rebooted multiple times on the day, then take details from the last boot of the day ... also cater for date being between 1 and 9 of the month, still further refinement.

Last edited by affinityvision; 02-06-2014 at 07:38 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Running kernel.org "mainline" Linux on Xen: FAILED to find root device bojanap Linux - Kernel 1 09-17-2010 11:42 PM
LVM has lost the plot - "Couldn't find device with uuid...." The Fold Slackware 0 10-21-2008 09:54 AM
FC6 Install Problem: "Unable to find any device of the type needed for instal" AeroGT3 Fedora 23 05-21-2008 10:40 PM
Can't find the "Linux Device Drivers" online book! gentoolman Linux - Hardware 4 01-16-2007 12:36 PM
"Cannot find root device" this is a bad error right? steventux Linux - General 1 02-23-2003 02:42 AM


All times are GMT -5. The time now is 09:08 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration