# Identifying disk from ata number

## plink212

I have a problem with one of my disks and am trying to work out which one.

The problem is that I have 6 identical ones and need the serial number to work out which one it is.

```
Aug 14 04:34:19 mail kernel: ata3.00: exception Emask 0x0 SAct 0x1 SErr 0x0 action 0x0

Aug 14 04:34:19 mail kernel: ata3.00: irq_stat 0x40000008

Aug 14 04:34:19 mail kernel: ata3.00: failed command: READ FPDMA QUEUED

Aug 14 04:34:19 mail kernel: ata3.00: cmd 60/80:00:71:10:3c/03:00:00:00:00/40 tag 0 ncq 458752 in

Aug 14 04:34:19 mail kernel: ata3.00: status: { DRDY ERR }

Aug 14 04:34:19 mail kernel: ata3.00: error: { UNC }

Aug 14 04:34:19 mail kernel: ata3.00: configured for UDMA/133

Aug 14 04:34:19 mail kernel: ata3: EH complete

```

how do i convert this ata number back into the respective sd* so that I can get the serial number from the drive

Tim

----------

## idella4

plink212;  

 *Quote:*   

> 
> 
>  and need the serial number to work out which one it is
> 
> 

 

You need the serial number of the drive to work out which drive??  I really don't quite follow. 

Do you mean you need to work out which it is to observe the serial number?

 Have you tried lspci -v?

There's a package called smartmontools that might work for you.

What causes you to conclude a drive is troublesome?

----------

## plink212

I have six identical seagate 1.5tb drives all with the same model number.

The drive with id ata3 is causing the raid array to lockup.

I need to work out which one of the 6 drives ata3 is so that I can replace it.

My question is how do I get more information about ata3.

Tim

----------

## Amity88

have you tried checking out the /proc/scsi/scsi file?

----------

## plink212

Like the idea but cannot see ata3

```

Attached devices:

Host: scsi0 Channel: 00 Id: 00 Lun: 00

  Vendor: ATA      Model: ST31500341AS     Rev: CC71

  Type:   Direct-Access                    ANSI  SCSI revision: 05

Host: scsi1 Channel: 00 Id: 00 Lun: 00

  Vendor: ATA      Model: SAMSUNG HD154UI  Rev: 1AG0

  Type:   Direct-Access                    ANSI  SCSI revision: 05

Host: scsi2 Channel: 00 Id: 00 Lun: 00

  Vendor: ATA      Model: ST31500341AS     Rev: CC1G

  Type:   Direct-Access                    ANSI  SCSI revision: 05

Host: scsi4 Channel: 00 Id: 00 Lun: 00

  Vendor: ATA      Model: ST31500341AS     Rev: CC1G

  Type:   Direct-Access                    ANSI  SCSI revision: 05

Host: scsi5 Channel: 00 Id: 00 Lun: 00

  Vendor: ATA      Model: ST31500341AS     Rev: CC1G

  Type:   Direct-Access                    ANSI  SCSI revision: 05

Host: scsi10 Channel: 00 Id: 00 Lun: 00

  Vendor: HL-DT-ST Model: DVDRAM GE20NU10  Rev: EE06

  Type:   CD-ROM                           ANSI  SCSI revision: 00

Host: scsi6 Channel: 00 Id: 00 Lun: 00

  Vendor: HL-DT-ST Model: BDDVDRW GGC-H20L Rev: 1.03

  Type:   CD-ROM                           ANSI  SCSI revision: 05

Host: scsi7 Channel: 00 Id: 00 Lun: 00

  Vendor: ATA      Model: ST31500341AS     Rev: CC1G

  Type:   Direct-Access                    ANSI  SCSI revision: 05

Host: scsi8 Channel: 00 Id: 00 Lun: 00

  Vendor: PHILIPS  Model: SPD2400L1        Rev: Y5H3

  Type:   CD-ROM                           ANSI  SCSI revision: 05

```

----------

## Amity88

I thought you said that there are 6 identical drives...

----------

## plink212

ok so it is 5 and a random samsung.

Still not closer though as I still don't know which one is ata3

----------

## RedSquirrel

Can you get any info by visually inspecting dmesg ouput?

```
dmesg | less
```

Example:

```
ata3.00:

.

.

.

.

.

 sdc: <----------------------

.

.

.
```

----------

## plink212

Nice idea but I can only guess it is /dev/sdc from this

```

ata2.00: ATA-7: SAMSUNG HD154UI, 1AG01118, max UDMA7

ata2.00: 2930277168 sectors, multi 0: LBA48 NCQ (depth 31/32)

ata2.00: configured for UDMA/133

ata5.00: ATA-8: ST31500341AS, CC1G, max UDMA/133

ata1.00: ATA-8: ST31500341AS, CC71, max UDMA/133

ata1.00: 2930277168 sectors, multi 0: LBA48 NCQ (depth 31/32)

ata3.00: ATA-8: ST31500341AS, CC1G, max UDMA/133

ata3.00: 2930277168 sectors, multi 0: LBA48 NCQ (depth 31/32)

ata6.00: ATA-8: ST31500341AS, CC1G, max UDMA/133

ata6.00: 2930277168 sectors, multi 0: LBA48 NCQ (depth 31/32)

ata5.00: 2930277168 sectors, multi 0: LBA48 NCQ (depth 31/32)

ata3.00: configured for UDMA/133

ata1.00: configured for UDMA/133

scsi 0:0:0:0: Direct-Access     ATA      ST31500341AS     CC71 PQ: 0 ANSI: 5

sd 0:0:0:0: [sda] 2930277168 512-byte logical blocks: (1.50 TB/1.36 TiB)

sd 0:0:0:0: Attached scsi generic sg0 type 0

sd 0:0:0:0: [sda] Write Protect is off

sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00

scsi 1:0:0:0: Direct-Access     ATA      SAMSUNG HD154UI  1AG0 PQ: 0 ANSI: 5

sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA

sd 1:0:0:0: [sdb] 2930277168 512-byte logical blocks: (1.50 TB/1.36 TiB)

sd 1:0:0:0: [sdb] Write Protect is off

sd 1:0:0:0: [sdb] Mode Sense: 00 3a 00 00

sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA

 sda:

sd 1:0:0:0: Attached scsi generic sg1 type 0

 sdb:

ata5.00: configured for UDMA/133

ata6.00: configured for UDMA/133

scsi 2:0:0:0: Direct-Access     ATA      ST31500341AS     CC1G PQ: 0 ANSI: 5

sd 2:0:0:0: [sdc] 2930277168 512-byte logical blocks: (1.50 TB/1.36 TiB)

sd 2:0:0:0: [sdc] Write Protect is off

sd 2:0:0:0: [sdc] Mode Sense: 00 3a 00 00

sd 2:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA

sd 2:0:0:0: Attached scsi generic sg2 type 0

 sdc:

scsi 4:0:0:0: Direct-Access     ATA      ST31500341AS     CC1G PQ: 0 ANSI: 5

sd 4:0:0:0: [sdd] 2930277168 512-byte logical blocks: (1.50 TB/1.36 TiB)

sd 4:0:0:0: Attached scsi generic sg3 type 0

scsi 5:0:0:0: Direct-Access     ATA      ST31500341AS     CC1G PQ: 0 ANSI: 5

sd 5:0:0:0: [sde] 2930277168 512-byte logical blocks: (1.50 TB/1.36 TiB)

sd 5:0:0:0: [sde] Write Protect is off

sd 5:0:0:0: [sde] Mode Sense: 00 3a 00 00

sd 5:0:0:0: [sde] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA

sd 5:0:0:0: Attached scsi generic sg4 type 0

 sde:

sd 4:0:0:0: [sdd] Write Protect is off

```

----------

## py-ro

Just do it reverse, get SN of your working drives, this one with serial you didn't have...

Py

----------

## plink212

No I think you have missed the point.

I have 5 seagate 1.5tb disks one of them is going bad.

I know it is ata3.

I need to know which drive is ata3.

If i can find out the sd letter then I can use hdparm to interrogate the drive to get the serial number.

Else I need to work out how to get the serial number from the ata3 moniker.

Tim

----------

## py-ro

Ok.

Is /sys/module/ahci/drivers/pci_ahci/... helpfull?

On my System host0 - host4 are sda - sdd, but dunno if there is a SN 

Py

EDIT: And also ata0 - ata3

----------

## plink212

ok have found that and looks like a winner, but how do you know they are sda etc or ata etc?

Tim

----------

