linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Which disk is ata4?
@ 2012-08-30  4:38 Andy Lutomirski
  2012-08-30  8:49 ` Bjoern Franke
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Andy Lutomirski @ 2012-08-30  4:38 UTC (permalink / raw)
  To: linux-kernel, linux-ide

One of my disks went out to lunch for a while.  Logs below.

Which one is it?  The only useful thing in /sys/class/ata_port/ata4 is
the device symlink, which points at
/sys/devices/pci0000:00/0000:00:1f.2/ata4.  That, in turn, has an
ata_port directory (contains nothing I don't already know) and a link4
directory.  The ata_link directory is unhelpful, as is
/sys/devices/pci0000:00/0000:00:1f.2/ata4/link4/dev4.0/ata_device/dev4.0.

Taking a leap of faith, /sys/devices/pci0000:00/0000:00:1f.2 contains
ata1-6 and host0-5.  So maybe ata4 is host3.  Following lots of
symlinks through host3 leads me to the block device sdd.  Maybe that's
correct?  I'm really not sure.  Am I missing something obvious?

I even tried looking for symlinks the other way, like this:

/sys$ find -type l -exec echo -n {} ' ' \; -exec readlink {} \; |grep ata4
./devices/pci0000:00/0000:00:1f.2/ata4/ata_port/ata4/subsystem
../../../../../../class/ata_port
./devices/pci0000:00/0000:00:1f.2/ata4/ata_port/ata4/device  ../../../ata4
./devices/pci0000:00/0000:00:1f.2/ata4/link4/ata_link/link4/subsystem
../../../../../../../class/ata_link
./devices/pci0000:00/0000:00:1f.2/ata4/link4/ata_link/link4/device
../../../link4
./devices/pci0000:00/0000:00:1f.2/ata4/link4/dev4.0/ata_device/dev4.0/subsystem
 ../../../../../../../../class/ata_device
./devices/pci0000:00/0000:00:1f.2/ata4/link4/dev4.0/ata_device/dev4.0/device
 ../../../dev4.0
./class/ata_link/link4
../../devices/pci0000:00/0000:00:1f.2/ata4/link4/ata_link/link4
./class/ata_port/ata4  ../../devices/pci0000:00/0000:00:1f.2/ata4/ata_port/ata4
./class/ata_device/dev4.0
../../devices/pci0000:00/0000:00:1f.2/ata4/link4/dev4.0/ata_device/dev4.0

No luck.

[784786.047673] ata4.00: exception Emask 0x10 SAct 0x7800 SErr 0x0
action 0x6 frozen
[784786.047707] ata4.00: irq_stat 0x08000000, interface fatal error
[784786.047730] ata4.00: failed command: READ FPDMA QUEUED
[784786.047752] ata4.00: cmd 60/40:58:80:a9:48/00:00:86:00:00/40 tag
11 ncq 32768 in
[784786.047753]          res c0/00:40:80:15:8d/00:00:86:00:00/40 Emask
0x12 (ATA bus error)
[784786.047805] ata4.00: status: { Busy }
[784786.047819] ata4.00: failed command: READ FPDMA QUEUED
[784786.047840] ata4.00: cmd 60/40:60:80:aa:48/00:00:86:00:00/40 tag
12 ncq 32768 in
[784786.047841]          res c0/00:40:80:15:8d/00:00:86:00:00/40 Emask
0x12 (ATA bus error)
[784786.047893] ata4.00: status: { Busy }
[784786.047907] ata4.00: failed command: READ FPDMA QUEUED
[784786.047928] ata4.00: cmd 60/40:68:c0:aa:48/00:00:86:00:00/40 tag
13 ncq 32768 in
[784786.047929]          res c0/00:40:80:15:8d/00:00:86:00:00/40 Emask
0x12 (ATA bus error)
[784786.047981] ata4.00: status: { Busy }
[784786.047996] ata4.00: failed command: READ FPDMA QUEUED
[784786.048016] ata4.00: cmd 60/40:70:00:ab:48/00:00:86:00:00/40 tag
14 ncq 32768 in
[784786.048017]          res c0/00:40:80:15:8d/00:00:86:00:00/40 Emask
0x12 (ATA bus error)
[784786.048067] ata4.00: status: { Busy }
[784786.048085] ata4: hard resetting link
[784786.365119] ata4: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
[784786.380854] ata4.00: ACPI cmd ef/10:06:00:00:00:00 (SET FEATURES) succeeded
[784786.380860] ata4.00: ACPI cmd f5/00:00:00:00:00:00 (SECURITY
FREEZE LOCK) filtered out
[784786.380864] ata4.00: ACPI cmd b1/c1:00:00:00:00:00 (DEVICE
CONFIGURATION OVERLAY) filtered out
[784786.382279] ata4.00: ACPI cmd ef/10:06:00:00:00:00 (SET FEATURES) succeeded
[784786.382283] ata4.00: ACPI cmd f5/00:00:00:00:00:00 (SECURITY
FREEZE LOCK) filtered out
[784786.382287] ata4.00: ACPI cmd b1/c1:00:00:00:00:00 (DEVICE
CONFIGURATION OVERLAY) filtered out
[784786.382747] ata4.00: configured for UDMA/133
[784786.382761] ata4: EH complete

--Andy

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Which disk is ata4?
  2012-08-30  4:38 Which disk is ata4? Andy Lutomirski
@ 2012-08-30  8:49 ` Bjoern Franke
  2012-08-30 15:17   ` Andy Lutomirski
  2012-08-30 15:15 ` Tim Nufire
  2012-08-30 16:14 ` Jan Engelhardt
  2 siblings, 1 reply; 12+ messages in thread
From: Bjoern Franke @ 2012-08-30  8:49 UTC (permalink / raw)
  To: Andy Lutomirski; +Cc: linux-kernel

Am Mittwoch, den 29.08.2012, 21:38 -0700 schrieb Andy Lutomirski:
> One of my disks went out to lunch for a while.  Logs below.

dmesg | grep ata4

for instance with ata1:
[root@ostrea][/]# dmesg | grep ata1
ata1.00: ATA-7: SAMSUNG MP0402H, UC200-16, max UDMA/100


-- 
xmpp: bjo@schafweide.org
bjo.nord-west.org | nord-west.org | freifunk-ol.de


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Which disk is ata4?
  2012-08-30  4:38 Which disk is ata4? Andy Lutomirski
  2012-08-30  8:49 ` Bjoern Franke
@ 2012-08-30 15:15 ` Tim Nufire
  2012-08-30 15:27   ` Andy Lutomirski
  2012-08-30 16:14 ` Jan Engelhardt
  2 siblings, 1 reply; 12+ messages in thread
From: Tim Nufire @ 2012-08-30 15:15 UTC (permalink / raw)
  To: Andy Lutomirski; +Cc: linux-kernel, linux-ide


I'm not sure if there is a better way, but on Debian 5 "Squeeze" I look at the contents of the directory /dev/disk/by-path/

ls -l /dev/disk/by-path/
total 0
lrwxrwxrwx 1 root root 10 2012-08-08 14:42 pci-0000:00:1f.2-scsi-0:0:0:0 -> ../../sdae
lrwxrwxrwx 1 root root 11 2012-08-08 14:42 pci-0000:00:1f.2-scsi-0:0:0:0-part1 -> ../../sdae1
lrwxrwxrwx 1 root root 11 2012-08-08 14:42 pci-0000:00:1f.2-scsi-0:0:0:0-part2 -> ../../sdae2
lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:02:04.0-scsi-0:0:0:0 -> ../../sda
lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:02:04.0-scsi-0:1:0:0 -> ../../sdb
lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:02:04.0-scsi-0:2:0:0 -> ../../sdc
lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:02:04.0-scsi-0:3:0:0 -> ../../sdd
lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:02:04.0-scsi-0:4:0:0 -> ../../sde
lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:02:04.0-scsi-3:0:0:0 -> ../../sdf
lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:02:04.0-scsi-3:1:0:0 -> ../../sdg
lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:02:04.0-scsi-3:2:0:0 -> ../../sdh
lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:02:04.0-scsi-3:3:0:0 -> ../../sdi
lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:02:04.0-scsi-3:4:0:0 -> ../../sdj
lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:02:04.0-scsi-4:0:0:0 -> ../../sdk
lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:02:04.0-scsi-4:1:0:0 -> ../../sdl
lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:02:04.0-scsi-4:2:0:0 -> ../../sdm
lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:02:04.0-scsi-4:3:0:0 -> ../../sdn
lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:02:04.0-scsi-4:4:0:0 -> ../../sdo
lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:04:04.0-scsi-0:0:0:0 -> ../../sdp
lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:04:04.0-scsi-0:1:0:0 -> ../../sdq
lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:04:04.0-scsi-0:2:0:0 -> ../../sdr
lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:04:04.0-scsi-0:3:0:0 -> ../../sds
lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:04:04.0-scsi-0:4:0:0 -> ../../sdt
lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:04:04.0-scsi-2:0:0:0 -> ../../sdu
lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:04:04.0-scsi-2:1:0:0 -> ../../sdv
lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:04:04.0-scsi-2:2:0:0 -> ../../sdw
lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:04:04.0-scsi-2:3:0:0 -> ../../sdx
lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:04:04.0-scsi-2:4:0:0 -> ../../sdy
lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:04:04.0-scsi-3:0:0:0 -> ../../sdz
lrwxrwxrwx 1 root root 10 2012-08-08 14:42 pci-0000:04:04.0-scsi-3:1:0:0 -> ../../sdaa
lrwxrwxrwx 1 root root 10 2012-08-08 14:42 pci-0000:04:04.0-scsi-3:2:0:0 -> ../../sdab
lrwxrwxrwx 1 root root 10 2012-08-08 14:42 pci-0000:04:04.0-scsi-3:3:0:0 -> ../../sdac
lrwxrwxrwx 1 root root 10 2012-08-08 14:42 pci-0000:04:04.0-scsi-3:4:0:0 -> ../../sdad
lrwxrwxrwx 1 root root 10 2012-08-08 14:42 pci-0000:06:04.0-scsi-0:0:0:0 -> ../../sdaf
lrwxrwxrwx 1 root root 10 2012-08-08 14:42 pci-0000:06:04.0-scsi-0:1:0:0 -> ../../sdag
lrwxrwxrwx 1 root root 10 2012-08-08 14:42 pci-0000:06:04.0-scsi-0:2:0:0 -> ../../sdah
lrwxrwxrwx 1 root root 10 2012-08-08 14:42 pci-0000:06:04.0-scsi-0:3:0:0 -> ../../sdai
lrwxrwxrwx 1 root root 10 2012-08-08 14:42 pci-0000:06:04.0-scsi-0:4:0:0 -> ../../sdaj
lrwxrwxrwx 1 root root 10 2012-08-08 14:42 pci-0000:06:04.0-scsi-2:0:0:0 -> ../../sdak
lrwxrwxrwx 1 root root 10 2012-08-08 14:42 pci-0000:06:04.0-scsi-2:1:0:0 -> ../../sdal
lrwxrwxrwx 1 root root 10 2012-08-08 14:42 pci-0000:06:04.0-scsi-2:2:0:0 -> ../../sdam
lrwxrwxrwx 1 root root 10 2012-08-08 14:42 pci-0000:06:04.0-scsi-2:3:0:0 -> ../../sdan
lrwxrwxrwx 1 root root 10 2012-08-08 14:42 pci-0000:06:04.0-scsi-2:4:0:0 -> ../../sdao
lrwxrwxrwx 1 root root 10 2012-08-08 14:42 pci-0000:06:04.0-scsi-3:0:0:0 -> ../../sdap
lrwxrwxrwx 1 root root 10 2012-08-08 14:42 pci-0000:06:04.0-scsi-3:1:0:0 -> ../../sdaq
lrwxrwxrwx 1 root root 10 2012-08-08 14:42 pci-0000:06:04.0-scsi-3:2:0:0 -> ../../sdar
lrwxrwxrwx 1 root root 10 2012-08-08 14:42 pci-0000:06:04.0-scsi-3:3:0:0 -> ../../sdas
lrwxrwxrwx 1 root root 10 2012-08-08 14:42 pci-0000:06:04.0-scsi-3:4:0:0 -> ../../sdat

The SCSI ids are one less than ATA ids because they start at 0 rather than 1. So, ata4.00 is the same as scsi-3:0:0:0. On my system this means that ata4.00 is sdap.

Tim

On Aug 29, 2012, at 9:38 PM, Andy Lutomirski <luto@amacapital.net> wrote:

> One of my disks went out to lunch for a while.  Logs below.
> 
> Which one is it?  The only useful thing in /sys/class/ata_port/ata4 is
> the device symlink, which points at
> /sys/devices/pci0000:00/0000:00:1f.2/ata4.  That, in turn, has an
> ata_port directory (contains nothing I don't already know) and a link4
> directory.  The ata_link directory is unhelpful, as is
> /sys/devices/pci0000:00/0000:00:1f.2/ata4/link4/dev4.0/ata_device/dev4.0.
> 
> Taking a leap of faith, /sys/devices/pci0000:00/0000:00:1f.2 contains
> ata1-6 and host0-5.  So maybe ata4 is host3.  Following lots of
> symlinks through host3 leads me to the block device sdd.  Maybe that's
> correct?  I'm really not sure.  Am I missing something obvious?
> 
> I even tried looking for symlinks the other way, like this:
> 
> /sys$ find -type l -exec echo -n {} ' ' \; -exec readlink {} \; |grep ata4
> ./devices/pci0000:00/0000:00:1f.2/ata4/ata_port/ata4/subsystem
> ../../../../../../class/ata_port
> ./devices/pci0000:00/0000:00:1f.2/ata4/ata_port/ata4/device  ../../../ata4
> ./devices/pci0000:00/0000:00:1f.2/ata4/link4/ata_link/link4/subsystem
> ../../../../../../../class/ata_link
> ./devices/pci0000:00/0000:00:1f.2/ata4/link4/ata_link/link4/device
> ../../../link4
> ./devices/pci0000:00/0000:00:1f.2/ata4/link4/dev4.0/ata_device/dev4.0/subsystem
> ../../../../../../../../class/ata_device
> ./devices/pci0000:00/0000:00:1f.2/ata4/link4/dev4.0/ata_device/dev4.0/device
> ../../../dev4.0
> ./class/ata_link/link4
> ../../devices/pci0000:00/0000:00:1f.2/ata4/link4/ata_link/link4
> ./class/ata_port/ata4  ../../devices/pci0000:00/0000:00:1f.2/ata4/ata_port/ata4
> ./class/ata_device/dev4.0
> ../../devices/pci0000:00/0000:00:1f.2/ata4/link4/dev4.0/ata_device/dev4.0
> 
> No luck.
> 
> [784786.047673] ata4.00: exception Emask 0x10 SAct 0x7800 SErr 0x0
> action 0x6 frozen
> [784786.047707] ata4.00: irq_stat 0x08000000, interface fatal error
> [784786.047730] ata4.00: failed command: READ FPDMA QUEUED
> [784786.047752] ata4.00: cmd 60/40:58:80:a9:48/00:00:86:00:00/40 tag
> 11 ncq 32768 in
> [784786.047753]          res c0/00:40:80:15:8d/00:00:86:00:00/40 Emask
> 0x12 (ATA bus error)
> [784786.047805] ata4.00: status: { Busy }
> [784786.047819] ata4.00: failed command: READ FPDMA QUEUED
> [784786.047840] ata4.00: cmd 60/40:60:80:aa:48/00:00:86:00:00/40 tag
> 12 ncq 32768 in
> [784786.047841]          res c0/00:40:80:15:8d/00:00:86:00:00/40 Emask
> 0x12 (ATA bus error)
> [784786.047893] ata4.00: status: { Busy }
> [784786.047907] ata4.00: failed command: READ FPDMA QUEUED
> [784786.047928] ata4.00: cmd 60/40:68:c0:aa:48/00:00:86:00:00/40 tag
> 13 ncq 32768 in
> [784786.047929]          res c0/00:40:80:15:8d/00:00:86:00:00/40 Emask
> 0x12 (ATA bus error)
> [784786.047981] ata4.00: status: { Busy }
> [784786.047996] ata4.00: failed command: READ FPDMA QUEUED
> [784786.048016] ata4.00: cmd 60/40:70:00:ab:48/00:00:86:00:00/40 tag
> 14 ncq 32768 in
> [784786.048017]          res c0/00:40:80:15:8d/00:00:86:00:00/40 Emask
> 0x12 (ATA bus error)
> [784786.048067] ata4.00: status: { Busy }
> [784786.048085] ata4: hard resetting link
> [784786.365119] ata4: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
> [784786.380854] ata4.00: ACPI cmd ef/10:06:00:00:00:00 (SET FEATURES) succeeded
> [784786.380860] ata4.00: ACPI cmd f5/00:00:00:00:00:00 (SECURITY
> FREEZE LOCK) filtered out
> [784786.380864] ata4.00: ACPI cmd b1/c1:00:00:00:00:00 (DEVICE
> CONFIGURATION OVERLAY) filtered out
> [784786.382279] ata4.00: ACPI cmd ef/10:06:00:00:00:00 (SET FEATURES) succeeded
> [784786.382283] ata4.00: ACPI cmd f5/00:00:00:00:00:00 (SECURITY
> FREEZE LOCK) filtered out
> [784786.382287] ata4.00: ACPI cmd b1/c1:00:00:00:00:00 (DEVICE
> CONFIGURATION OVERLAY) filtered out
> [784786.382747] ata4.00: configured for UDMA/133
> [784786.382761] ata4: EH complete
> 
> --Andy
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ide" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Which disk is ata4?
  2012-08-30  8:49 ` Bjoern Franke
@ 2012-08-30 15:17   ` Andy Lutomirski
  2012-08-30 15:22     ` Borislav Petkov
  0 siblings, 1 reply; 12+ messages in thread
From: Andy Lutomirski @ 2012-08-30 15:17 UTC (permalink / raw)
  To: Bjoern Franke; +Cc: linux-kernel

On Thu, Aug 30, 2012 at 1:49 AM, Bjoern Franke <bjo@nord-west.org> wrote:
> Am Mittwoch, den 29.08.2012, 21:38 -0700 schrieb Andy Lutomirski:
>> One of my disks went out to lunch for a while.  Logs below.
>
> dmesg | grep ata4
>
> for instance with ata1:
> [root@ostrea][/]# dmesg | grep ata1
> ata1.00: ATA-7: SAMSUNG MP0402H, UC200-16, max UDMA/100

I tried that, too.

$ dmesg |grep ST3000DM001-9YN166
[    1.064910] ata5.00: ATA-8: ST3000DM001-9YN166, CC4B, max UDMA/133
[    1.064926] ata3.00: ATA-8: ST3000DM001-9YN166, CC4B, max UDMA/133
[    1.064986] ata2.00: ATA-8: ST3000DM001-9YN166, CC4B, max UDMA/133
[    1.065012] ata4.00: ATA-8: ST3000DM001-9YN166, CC4B, max UDMA/133
[    1.235753] ata7.00: ATA-8: ST3000DM001-9YN166, CC4B, max UDMA/133
[    1.727000] ata8.00: ATA-8: ST3000DM001-9YN166, CC4B, max UDMA/133

This is unhelpful.

Also, the dmesg lines are nicely interleaved, making it rather hard to
line up ataN lines with sdX lines.

--Andy

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Which disk is ata4?
  2012-08-30 15:17   ` Andy Lutomirski
@ 2012-08-30 15:22     ` Borislav Petkov
  2012-08-30 16:08       ` Jan Engelhardt
  0 siblings, 1 reply; 12+ messages in thread
From: Borislav Petkov @ 2012-08-30 15:22 UTC (permalink / raw)
  To: Andy Lutomirski; +Cc: Bjoern Franke, linux-kernel

On Thu, Aug 30, 2012 at 08:17:13AM -0700, Andy Lutomirski wrote:
> $ dmesg |grep ST3000DM001-9YN166
> [    1.064910] ata5.00: ATA-8: ST3000DM001-9YN166, CC4B, max UDMA/133
> [    1.064926] ata3.00: ATA-8: ST3000DM001-9YN166, CC4B, max UDMA/133
> [    1.064986] ata2.00: ATA-8: ST3000DM001-9YN166, CC4B, max UDMA/133
> [    1.065012] ata4.00: ATA-8: ST3000DM001-9YN166, CC4B, max UDMA/133
> [    1.235753] ata7.00: ATA-8: ST3000DM001-9YN166, CC4B, max UDMA/133
> [    1.727000] ata8.00: ATA-8: ST3000DM001-9YN166, CC4B, max UDMA/133

Shouldn't the SATA ports have actually numbers on the motherboard. And
if so, ata4 should be the 4th port in the nomenclature... Then it is
only about following the cable :).

-- 
Regards/Gruss,
Boris.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Which disk is ata4?
  2012-08-30 15:15 ` Tim Nufire
@ 2012-08-30 15:27   ` Andy Lutomirski
  0 siblings, 0 replies; 12+ messages in thread
From: Andy Lutomirski @ 2012-08-30 15:27 UTC (permalink / raw)
  To: Tim Nufire; +Cc: linux-kernel, linux-ide

On Thu, Aug 30, 2012 at 8:15 AM, Tim Nufire <linux_ide_tim@ibink.com> wrote:
>
> I'm not sure if there is a better way, but on Debian 5 "Squeeze" I look at the contents of the directory /dev/disk/by-path/
>
> ls -l /dev/disk/by-path/
> total 0
> lrwxrwxrwx 1 root root 10 2012-08-08 14:42 pci-0000:00:1f.2-scsi-0:0:0:0 -> ../../sdae
> lrwxrwxrwx 1 root root 11 2012-08-08 14:42 pci-0000:00:1f.2-scsi-0:0:0:0-part1 -> ../../sdae1
> lrwxrwxrwx 1 root root 11 2012-08-08 14:42 pci-0000:00:1f.2-scsi-0:0:0:0-part2 -> ../../sdae2
> lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:02:04.0-scsi-0:0:0:0 -> ../../sda
> lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:02:04.0-scsi-0:1:0:0 -> ../../sdb
> lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:02:04.0-scsi-0:2:0:0 -> ../../sdc
> lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:02:04.0-scsi-0:3:0:0 -> ../../sdd
> lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:02:04.0-scsi-0:4:0:0 -> ../../sde
> lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:02:04.0-scsi-3:0:0:0 -> ../../sdf
> lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:02:04.0-scsi-3:1:0:0 -> ../../sdg
> lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:02:04.0-scsi-3:2:0:0 -> ../../sdh
> lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:02:04.0-scsi-3:3:0:0 -> ../../sdi
> lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:02:04.0-scsi-3:4:0:0 -> ../../sdj
> lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:02:04.0-scsi-4:0:0:0 -> ../../sdk
> lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:02:04.0-scsi-4:1:0:0 -> ../../sdl
> lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:02:04.0-scsi-4:2:0:0 -> ../../sdm
> lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:02:04.0-scsi-4:3:0:0 -> ../../sdn
> lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:02:04.0-scsi-4:4:0:0 -> ../../sdo
> lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:04:04.0-scsi-0:0:0:0 -> ../../sdp
> lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:04:04.0-scsi-0:1:0:0 -> ../../sdq
> lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:04:04.0-scsi-0:2:0:0 -> ../../sdr
> lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:04:04.0-scsi-0:3:0:0 -> ../../sds
> lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:04:04.0-scsi-0:4:0:0 -> ../../sdt
> lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:04:04.0-scsi-2:0:0:0 -> ../../sdu
> lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:04:04.0-scsi-2:1:0:0 -> ../../sdv
> lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:04:04.0-scsi-2:2:0:0 -> ../../sdw
> lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:04:04.0-scsi-2:3:0:0 -> ../../sdx
> lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:04:04.0-scsi-2:4:0:0 -> ../../sdy
> lrwxrwxrwx 1 root root  9 2012-08-08 14:42 pci-0000:04:04.0-scsi-3:0:0:0 -> ../../sdz
> lrwxrwxrwx 1 root root 10 2012-08-08 14:42 pci-0000:04:04.0-scsi-3:1:0:0 -> ../../sdaa
> lrwxrwxrwx 1 root root 10 2012-08-08 14:42 pci-0000:04:04.0-scsi-3:2:0:0 -> ../../sdab
> lrwxrwxrwx 1 root root 10 2012-08-08 14:42 pci-0000:04:04.0-scsi-3:3:0:0 -> ../../sdac
> lrwxrwxrwx 1 root root 10 2012-08-08 14:42 pci-0000:04:04.0-scsi-3:4:0:0 -> ../../sdad
> lrwxrwxrwx 1 root root 10 2012-08-08 14:42 pci-0000:06:04.0-scsi-0:0:0:0 -> ../../sdaf
> lrwxrwxrwx 1 root root 10 2012-08-08 14:42 pci-0000:06:04.0-scsi-0:1:0:0 -> ../../sdag
> lrwxrwxrwx 1 root root 10 2012-08-08 14:42 pci-0000:06:04.0-scsi-0:2:0:0 -> ../../sdah
> lrwxrwxrwx 1 root root 10 2012-08-08 14:42 pci-0000:06:04.0-scsi-0:3:0:0 -> ../../sdai
> lrwxrwxrwx 1 root root 10 2012-08-08 14:42 pci-0000:06:04.0-scsi-0:4:0:0 -> ../../sdaj
> lrwxrwxrwx 1 root root 10 2012-08-08 14:42 pci-0000:06:04.0-scsi-2:0:0:0 -> ../../sdak
> lrwxrwxrwx 1 root root 10 2012-08-08 14:42 pci-0000:06:04.0-scsi-2:1:0:0 -> ../../sdal
> lrwxrwxrwx 1 root root 10 2012-08-08 14:42 pci-0000:06:04.0-scsi-2:2:0:0 -> ../../sdam
> lrwxrwxrwx 1 root root 10 2012-08-08 14:42 pci-0000:06:04.0-scsi-2:3:0:0 -> ../../sdan
> lrwxrwxrwx 1 root root 10 2012-08-08 14:42 pci-0000:06:04.0-scsi-2:4:0:0 -> ../../sdao
> lrwxrwxrwx 1 root root 10 2012-08-08 14:42 pci-0000:06:04.0-scsi-3:0:0:0 -> ../../sdap
> lrwxrwxrwx 1 root root 10 2012-08-08 14:42 pci-0000:06:04.0-scsi-3:1:0:0 -> ../../sdaq
> lrwxrwxrwx 1 root root 10 2012-08-08 14:42 pci-0000:06:04.0-scsi-3:2:0:0 -> ../../sdar
> lrwxrwxrwx 1 root root 10 2012-08-08 14:42 pci-0000:06:04.0-scsi-3:3:0:0 -> ../../sdas
> lrwxrwxrwx 1 root root 10 2012-08-08 14:42 pci-0000:06:04.0-scsi-3:4:0:0 -> ../../sdat
>
> The SCSI ids are one less than ATA ids because they start at 0 rather than 1. So, ata4.00 is the same as scsi-3:0:0:0. On my system this means that ata4.00 is sdap.

...which presumably stops working as soon as there's a non-ATA SCSI
device in the system.  (It worked for me, I think, but there really
ought to be a generic solution.)

Again, what's apparently missing is a map between ata
ports/links/devices and scsi hosts/targets/devices.

--Andy

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Which disk is ata4?
  2012-08-30 15:22     ` Borislav Petkov
@ 2012-08-30 16:08       ` Jan Engelhardt
  0 siblings, 0 replies; 12+ messages in thread
From: Jan Engelhardt @ 2012-08-30 16:08 UTC (permalink / raw)
  To: Borislav Petkov; +Cc: Andy Lutomirski, Bjoern Franke, linux-kernel

On Thursday 2012-08-30 17:22, Borislav Petkov wrote:

>On Thu, Aug 30, 2012 at 08:17:13AM -0700, Andy Lutomirski wrote:
>> $ dmesg |grep ST3000DM001-9YN166
>> [    1.064910] ata5.00: ATA-8: ST3000DM001-9YN166, CC4B, max UDMA/133
>> [    1.064926] ata3.00: ATA-8: ST3000DM001-9YN166, CC4B, max UDMA/133
>> [    1.064986] ata2.00: ATA-8: ST3000DM001-9YN166, CC4B, max UDMA/133
>> [    1.065012] ata4.00: ATA-8: ST3000DM001-9YN166, CC4B, max UDMA/133
>> [    1.235753] ata7.00: ATA-8: ST3000DM001-9YN166, CC4B, max UDMA/133
>> [    1.727000] ata8.00: ATA-8: ST3000DM001-9YN166, CC4B, max UDMA/133
>
>Shouldn't the SATA ports have actually numbers on the motherboard. And
>if so, ata4 should be the 4th port in the nomenclature... Then it is
>only about following the cable :).

That is not reliable, especially when extra PCI cards come into play.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Which disk is ata4?
  2012-08-30  4:38 Which disk is ata4? Andy Lutomirski
  2012-08-30  8:49 ` Bjoern Franke
  2012-08-30 15:15 ` Tim Nufire
@ 2012-08-30 16:14 ` Jan Engelhardt
  2012-08-30 16:29   ` Borislav Petkov
  2012-08-30 16:57   ` Andy Lutomirski
  2 siblings, 2 replies; 12+ messages in thread
From: Jan Engelhardt @ 2012-08-30 16:14 UTC (permalink / raw)
  To: Andy Lutomirski
  Cc: Linux Kernel Mailing List, linux-ide, Bjoern Franke,
	Borislav Petkov, Tim Nufire

On Thursday 2012-08-30 06:38, Andy Lutomirski wrote:

>One of my disks went out to lunch for a while.  Logs below.
>
>[784786.047673] ata4.00: exception Emask 0x10 SAct 0x7800 SErr 0x0
>action 0x6 frozen
>
>Which one is it?  The only useful thing in /sys/class/ata_port/ata4 is
>the device symlink, which points at
>/sys/devices/pci0000:00/0000:00:1f.2/ata4.

For example, ata2 here:

$ cd /sys/devices
$ find . -name ata2
./pci0000:00/0000:00:1f.2/ata2
./pci0000:00/0000:00:1f.2/ata2/ata_port/ata2
$ cd ./pci0000:00/0000:00:1f.2/ata2
$ ls -dl host*/targ*
drwxr-xr-x 4 root root 0 Aug 30 18:09 host1/target1:0:0
$ lsscsi
[0:0:0:0]    disk    ATA      ST3000DM001-9YN1 CC4C  /dev/sda 
[1:0:0:0]    disk    ATA      ST3000DM001-9YN1 CC4C  /dev/sdb 
# sdparm -i /dev/sdb
    /dev/sdb: ATA       ST3000DM001-9YN1  CC4C
Device identification VPD page:
  Addressed logical unit:
    designator type: vendor specific [0x0],  code set: ASCII
      vendor specific:             Z1F0KR3H
    designator type: T10 vendor identification,  code set: ASCII
      vendor id: ATA     
      vendor specific: ST3000DM001-9YN166
 Z1F0KR3H
    designator type: NAA,  code set: Binary
      0x5000c500408f772f

This tells me everything to replace a disk.
1. sdparm -C stop /dev/sdb
2. Removing Z1F0KR3H from the chassis.
3. Put new disk in..
(4. Profit.)

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Which disk is ata4?
  2012-08-30 16:14 ` Jan Engelhardt
@ 2012-08-30 16:29   ` Borislav Petkov
  2012-08-30 16:39     ` Alan Cox
  2012-08-30 16:57   ` Andy Lutomirski
  1 sibling, 1 reply; 12+ messages in thread
From: Borislav Petkov @ 2012-08-30 16:29 UTC (permalink / raw)
  To: Jan Engelhardt
  Cc: Andy Lutomirski, Linux Kernel Mailing List, linux-ide,
	Bjoern Franke, Tim Nufire

On Thu, Aug 30, 2012 at 06:14:46PM +0200, Jan Engelhardt wrote:
> This tells me everything to replace a disk.
> 1. sdparm -C stop /dev/sdb
> 2. Removing Z1F0KR3H from the chassis.

Yep, the serial number is the best suggestion so far.

Are we sure this serial number is always programmed in by the hdd
vendors so that sdparm can read it out?

I'm thinking here of the DMI debacle of some vendors.

Thanks.

-- 
Regards/Gruss,
Boris.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Which disk is ata4?
  2012-08-30 16:29   ` Borislav Petkov
@ 2012-08-30 16:39     ` Alan Cox
  0 siblings, 0 replies; 12+ messages in thread
From: Alan Cox @ 2012-08-30 16:39 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: Jan Engelhardt, Andy Lutomirski, Linux Kernel Mailing List,
	linux-ide, Bjoern Franke, Tim Nufire

On Thu, 30 Aug 2012 18:29:38 +0200
Borislav Petkov <bp@alien8.de> wrote:

> On Thu, Aug 30, 2012 at 06:14:46PM +0200, Jan Engelhardt wrote:
> > This tells me everything to replace a disk.
> > 1. sdparm -C stop /dev/sdb
> > 2. Removing Z1F0KR3H from the chassis.
> 
> Yep, the serial number is the best suggestion so far.
> 
> Are we sure this serial number is always programmed in by the hdd
> vendors so that sdparm can read it out?

With three known exceptions
- fake ones generated by some IT821X adapters in RAID mode
- certain old Maxtor PATA drives had a peculiar firmware failure where
  they changed to some kind of default serial number. Very unusual. Was
  never really fully explained and seems to have been very rare.
- drives so ancient they don't support IDENTIFY, and we don't support
  them in libata anyway !

Alan

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Which disk is ata4?
  2012-08-30 16:14 ` Jan Engelhardt
  2012-08-30 16:29   ` Borislav Petkov
@ 2012-08-30 16:57   ` Andy Lutomirski
  2012-08-30 17:13     ` Jan Engelhardt
  1 sibling, 1 reply; 12+ messages in thread
From: Andy Lutomirski @ 2012-08-30 16:57 UTC (permalink / raw)
  To: Jan Engelhardt
  Cc: Linux Kernel Mailing List, linux-ide, Bjoern Franke,
	Borislav Petkov, Tim Nufire

On Thu, Aug 30, 2012 at 9:14 AM, Jan Engelhardt <jengelh@inai.de> wrote:
> On Thursday 2012-08-30 06:38, Andy Lutomirski wrote:
>
>>One of my disks went out to lunch for a while.  Logs below.
>>
>>[784786.047673] ata4.00: exception Emask 0x10 SAct 0x7800 SErr 0x0
>>action 0x6 frozen
>>
>>Which one is it?  The only useful thing in /sys/class/ata_port/ata4 is
>>the device symlink, which points at
>>/sys/devices/pci0000:00/0000:00:1f.2/ata4.
>
> For example, ata2 here:
>
> $ cd /sys/devices
> $ find . -name ata2
> ./pci0000:00/0000:00:1f.2/ata2
> ./pci0000:00/0000:00:1f.2/ata2/ata_port/ata2
> $ cd ./pci0000:00/0000:00:1f.2/ata2
> $ ls -dl host*/targ*
> drwxr-xr-x 4 root root 0 Aug 30 18:09 host1/target1:0:0

Aha!  This works on 3.5 but not on 3.2.  Mystery solved (except on my
poor Ubuntu LTS box that has the host directories under the pci device
instead of under the ata devices).

Consider this report solved by "fixed in newer kernel".  I thought I
had checked for that.

It would be nice if the dmesg startup logs showed the serial number
along with the model number.

--Andy

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Which disk is ata4?
  2012-08-30 16:57   ` Andy Lutomirski
@ 2012-08-30 17:13     ` Jan Engelhardt
  0 siblings, 0 replies; 12+ messages in thread
From: Jan Engelhardt @ 2012-08-30 17:13 UTC (permalink / raw)
  To: Andy Lutomirski
  Cc: Linux Kernel Mailing List, linux-ide, Bjoern Franke,
	Borislav Petkov, Tim Nufire

On Thursday 2012-08-30 18:57, Andy Lutomirski wrote:

>On Thu, Aug 30, 2012 at 9:14 AM, Jan Engelhardt <jengelh@inai.de> wrote:
>> On Thursday 2012-08-30 06:38, Andy Lutomirski wrote:
>>
>>>One of my disks went out to lunch for a while.  Logs below.
>>>
>>>[784786.047673] ata4.00: exception Emask 0x10 SAct 0x7800 SErr 0x0
>>>action 0x6 frozen
>>>
>>>Which one is it?  The only useful thing in /sys/class/ata_port/ata4 is
>>>the device symlink, which points at
>>>/sys/devices/pci0000:00/0000:00:1f.2/ata4.
>>
>> For example, ata2 here:
>>
>> $ cd /sys/devices
>> $ find . -name ata2
>> ./pci0000:00/0000:00:1f.2/ata2
>> ./pci0000:00/0000:00:1f.2/ata2/ata_port/ata2
>> $ cd ./pci0000:00/0000:00:1f.2/ata2
>> $ ls -dl host*/targ*
>> drwxr-xr-x 4 root root 0 Aug 30 18:09 host1/target1:0:0
>
>Aha!  This works on 3.5 but not on 3.2.

3.4.x here..

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2012-08-30 17:13 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-30  4:38 Which disk is ata4? Andy Lutomirski
2012-08-30  8:49 ` Bjoern Franke
2012-08-30 15:17   ` Andy Lutomirski
2012-08-30 15:22     ` Borislav Petkov
2012-08-30 16:08       ` Jan Engelhardt
2012-08-30 15:15 ` Tim Nufire
2012-08-30 15:27   ` Andy Lutomirski
2012-08-30 16:14 ` Jan Engelhardt
2012-08-30 16:29   ` Borislav Petkov
2012-08-30 16:39     ` Alan Cox
2012-08-30 16:57   ` Andy Lutomirski
2012-08-30 17:13     ` Jan Engelhardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).