Wednesday, May 1, 2024
 Popular · Latest · Hot · Upcoming
7
rated 0 times [  7] [ 0]  / answers: 1 / hits: 8999  / 2 Years ago, tue, april 26, 2022, 2:42:31

Getting stuff like this in the logs:




Oct 2 22:11:21 jupiter kernel: [439646.093111] ata4.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6
Oct 2 22:11:21 jupiter kernel: [439646.093144] ata4.00: BMDMA stat 0x6
Oct 2 22:11:21 jupiter kernel: [439646.093176] ata4.00: failed command: WRITE DMA EXT
Oct 2 22:11:21 jupiter kernel: [439646.093206] ata4.00: cmd 35/00:98:00:0d:ff/00:02:42:00:00/e0 tag 0 dma 339968 out
Oct 2 22:11:21 jupiter kernel: [439646.093282] ata4.00: status: { DRDY ERR }
Oct 2 22:11:21 jupiter kernel: [439646.093306] ata4.00: error: { ICRC ABRT }
Oct 2 22:11:21 jupiter kernel: [439646.093353] ata4: soft resetting link
Oct 2 22:11:21 jupiter kernel: [439646.265242] ata4.00: configured for UDMA/133
Oct 2 22:11:21 jupiter kernel: [439646.265268] ata4: EH complete


Now I wonder which disk to replace. But I can't find any clear mapping between "ataX.YZ" and /dev/disk/ entries.


More From » disk

 Answers
3

  • You should get more information from dmesg:



    dmesg | grep ata


    Something like:



    [    2.345126] ata2.00: ATA-8: WDC WD20EARX-00PASB0, 51.0AB51, max UDMA/133


    That would be my Wester Digital hard drive.








  • Here's a way if you have multiple drives of one model (when above won't help):




    1. Find a mapping from SCSI host to the ata* ID:



      $ egrep "^[0-9]{1,}" /sys/class/scsi_host/host*/unique_id
      /sys/class/scsi_host/host0/unique_id:1
      /sys/class/scsi_host/host1/unique_id:2
      /sys/class/scsi_host/host2/unique_id:3
      /sys/class/scsi_host/host3/unique_id:4

    2. Find a mapping from the SCSI host to the sd* ID:



      $ ls -l /sys/block/sd*
      ... /sys/block/sda -> ../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda
      ... /sys/block/sdb -> ../devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0/block/sdb



    Now you can link those two results via the host* identifier. So if in that case I'm getting problems with ata2, I'd look for the unique_id 2 → host1, and then which sd* is host1 → sdb.








  • I also tried to come up with a one-liner. No idea if that's robust. You first have to set the ata* as a variable:



    FAIL=ata1


    then run:



    echo "$FAIL -> $(ls -l /sys/block/ | grep $(grep "^$(echo $FAIL | cut -c 4-)" /sys/class/scsi_host/host*/unique_id | sed "s/.*(host[0-9]{1,}).*/1/") | awk '{print $8}')"


    which should return something like:



    ata1 -> sda


[#43206] Tuesday, April 26, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
leadprogres

Total Points: 298
Total Questions: 114
Total Answers: 139

Location: Samoa
Member since Mon, Nov 8, 2021
3 Years ago
;