# what do these i/o errors mean?

## peter4

I'm trying to read a file from a worn-down drive. At one point I'm getting this in dmesg:

```
[88284.933397] ata5.00: exception Emask 0x0 SAct 0x1 SErr 0x0 action 0x0

[88284.933400] ata5.00: irq_stat 0x40000008

[88284.933402] ata5.00: failed command: READ FPDMA QUEUED

[88284.933406] ata5.00: cmd 60/00:00:ff:90:05/02:00:03:00:00/40 tag 0 ncq 262144 in

[88284.933407]          res 51/40:00:37:91:05/00:00:03:00:00/40 Emask 0x409 (media error) <F>

[88284.933409] ata5.00: status: { DRDY ERR }

[88284.933410] ata5.00: error: { UNC }

[88284.947234] ata5.00: configured for UDMA/133

[88284.947245] ata5: EH complete

[88292.024090] ata5.00: exception Emask 0x0 SAct 0x1 SErr 0x0 action 0x0

[88292.024093] ata5.00: irq_stat 0x40000008

[88292.024095] ata5.00: failed command: READ FPDMA QUEUED

[88292.024099] ata5.00: cmd 60/00:00:ff:90:05/02:00:03:00:00/40 tag 0 ncq 262144 in

[88292.024100]          res 51/40:00:37:91:05/00:00:03:00:00/40 Emask 0x409 (media error) <F>

[88292.024102] ata5.00: status: { DRDY ERR }

[88292.024103] ata5.00: error: { UNC }

[88292.037946] ata5.00: configured for UDMA/133

[88292.037959] ata5: EH complete

[88299.655340] ata5.00: exception Emask 0x0 SAct 0x1 SErr 0x0 action 0x0

[88299.655343] ata5.00: irq_stat 0x40000008

[88299.655346] ata5.00: failed command: READ FPDMA QUEUED

[88299.655349] ata5.00: cmd 60/00:00:ff:90:05/02:00:03:00:00/40 tag 0 ncq 262144 in

[88299.655350]          res 51/40:00:37:91:05/00:00:03:00:00/40 Emask 0x409 (media error) <F>

[88299.655352] ata5.00: status: { DRDY ERR }

[88299.655353] ata5.00: error: { UNC }

[88299.669187] ata5.00: configured for UDMA/133

[88299.669200] ata5: EH complete

[88306.735193] ata5.00: exception Emask 0x0 SAct 0x1 SErr 0x0 action 0x0

[88306.735195] ata5.00: irq_stat 0x40000008

[88306.735198] ata5.00: failed command: READ FPDMA QUEUED

[88306.735202] ata5.00: cmd 60/00:00:ff:90:05/02:00:03:00:00/40 tag 0 ncq 262144 in

[88306.735203]          res 51/40:00:37:91:05/00:00:03:00:00/40 Emask 0x409 (media error) <F>

[88306.735204] ata5.00: status: { DRDY ERR }

[88306.735206] ata5.00: error: { UNC }

[88306.749035] ata5.00: configured for UDMA/133

[88306.749047] ata5: EH complete

[88314.377461] ata5.00: exception Emask 0x0 SAct 0x1 SErr 0x0 action 0x0

[88314.377463] ata5.00: irq_stat 0x40000008

[88314.377466] ata5.00: failed command: READ FPDMA QUEUED

[88314.377470] ata5.00: cmd 60/00:00:ff:90:05/02:00:03:00:00/40 tag 0 ncq 262144 in

[88314.377471]          res 51/40:00:37:91:05/00:00:03:00:00/40 Emask 0x409 (media error) <F>

[88314.377473] ata5.00: status: { DRDY ERR }

[88314.377474] ata5.00: error: { UNC }

[88314.391301] ata5.00: configured for UDMA/133

[88314.391315] ata5: EH complete

[88322.648310] ata5.00: exception Emask 0x0 SAct 0x1 SErr 0x0 action 0x0

[88322.648312] ata5.00: irq_stat 0x40000008

[88322.648314] ata5.00: failed command: READ FPDMA QUEUED

[88322.648318] ata5.00: cmd 60/00:00:ff:90:05/02:00:03:00:00/40 tag 0 ncq 262144 in

[88322.648319]          res 51/40:00:37:91:05/00:00:03:00:00/40 Emask 0x409 (media error) <F>

[88322.648321] ata5.00: status: { DRDY ERR }

[88322.648322] ata5.00: error: { UNC }

[88322.662149] ata5.00: configured for UDMA/133

[88322.662180] sd 4:0:0:0: [sdd] Unhandled sense code

[88322.662181] sd 4:0:0:0: [sdd]  Result: hostbyte=0x00 driverbyte=0x08

[88322.662183] sd 4:0:0:0: [sdd]  Sense Key : 0x3 [current] [descriptor]

[88322.662186] Descriptor sense data with sense descriptors (in hex):

[88322.662187]         72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00 

[88322.662192]         03 05 91 37 

[88322.662194] sd 4:0:0:0: [sdd]  ASC=0x11 ASCQ=0x4

[88322.662196] sd 4:0:0:0: [sdd] CDB: cdb[0]=0x28: 28 00 03 05 90 ff 00 02 00 00

[88322.662201] end_request: I/O error, dev sdd, sector 50696503

[88322.662204] Buffer I/O error on device sdd1, logical block 6337055

[88322.662206] Buffer I/O error on device sdd1, logical block 6337056

[88322.662208] Buffer I/O error on device sdd1, logical block 6337057

[88322.662210] Buffer I/O error on device sdd1, logical block 6337058

[88322.662212] Buffer I/O error on device sdd1, logical block 6337059

[88322.662214] Buffer I/O error on device sdd1, logical block 6337060

[88322.662216] Buffer I/O error on device sdd1, logical block 6337061

[88322.662217] Buffer I/O error on device sdd1, logical block 6337062

[88322.662219] Buffer I/O error on device sdd1, logical block 6337063

[88322.662221] Buffer I/O error on device sdd1, logical block 6337064

[88322.662249] ata5: EH complete
```

The userspace program doesn't indicate any error, happily continue reading the file and report success at the end. So I'm lost here. Was this file read succesfully?

----------

## s_bernstein

These error usally indicates a failing drive. You better look for a replacement and make a backup now... if you value your data.

----------

## peter4

Yes, I know that. That's what I'm doing. I'm making a backup and get this messages in dmesg. I just want to know what this means -- whether the file was read successfully or not.

----------

## roarinelk

 *peter4 wrote:*   

> Yes, I know that. That's what I'm doing. I'm making a backup and get this messages in dmesg. I just want to know what this means -- whether the file was read successfully or not.

 

Data was lost, it even tells you on which blocks

----------

## peter4

Then what data did the reading program receive? There was no error, so it must have received some data.

----------

## roarinelk

 *peter4 wrote:*   

> Then what data did the reading program receive? There was no error, so it must have received some data.

 

usually when media errors happen cp and friends abort and report the IO error back.

So it depends on the program you use, but if it is worth anything it should abort and

not write zeroes.

----------

## peter4

I tested it with 'cat file > /dev/null'. Dmesg errors appeared, but cat did not bail out.

----------

