| | 167 | }}} |
| | 168 | |
| | 169 | On some occasions using `dd` may not result in the sector being reallocated, with an error along the following lines: |
| | 170 | |
| | 171 | {{{ |
| | 172 | May 24 14:19:30 ht-xm-2 kernel: ata1.00: exception Emask 0x0 SAct 0x8000000 SErr 0x0 action 0x0 |
| | 173 | May 24 14:19:30 ht-xm-2 kernel: ata1.00: irq_stat 0x40000008 |
| | 174 | May 24 14:19:30 ht-xm-2 kernel: ata1.00: failed command: READ FPDMA QUEUED |
| | 175 | May 24 14:19:30 ht-xm-2 kernel: ata1.00: cmd 60/08:d8:08:16:00/00:00:01:00:00/40 tag 27 ncq dma 4096 in |
| | 176 | res 41/40:08:0a:16:00/00:00:01:00:00/00 Emask 0x409 (media error) <F> |
| | 177 | May 24 14:19:30 ht-xm-2 kernel: ata1.00: status: { DRDY ERR } |
| | 178 | May 24 14:19:30 ht-xm-2 kernel: ata1.00: error: { UNC } |
| | 179 | May 24 14:19:30 ht-xm-2 kernel: ata1.00: configured for UDMA/133 |
| | 180 | May 24 14:19:30 ht-xm-2 kernel: sd 0:0:0:0: [sda] tag#27 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE |
| | 181 | May 24 14:19:30 ht-xm-2 kernel: sd 0:0:0:0: [sda] tag#27 Sense Key : Medium Error [current] |
| | 182 | May 24 14:19:30 ht-xm-2 kernel: sd 0:0:0:0: [sda] tag#27 Add. Sense: Unrecovered read error - auto reallocate failed |
| | 183 | May 24 14:19:30 ht-xm-2 kernel: sd 0:0:0:0: [sda] tag#27 CDB: Read(16) 88 00 00 00 00 00 01 00 16 08 00 00 00 08 00 00 |
| | 184 | May 24 14:19:30 ht-xm-2 kernel: blk_update_request: I/O error, dev sda, sector 16782858 |
| | 185 | May 24 14:19:30 ht-xm-2 kernel: Buffer I/O error on dev sda, logical block 2097857, async page read |
| | 186 | May 24 14:19:30 ht-xm-2 kernel: ata1: EH complete |
| | 187 | }}} |
| | 188 | |
| | 189 | In this case you may have better success using the `hdparm` tool. First confirm the read error on the sector, which would look like this for the above error: |
| | 190 | |
| | 191 | {{{ |
| | 192 | # hdparm --read-sector 16782858 /dev/sda |
| | 193 | }}} |
| | 194 | |
| | 195 | And when you've confirmed the sector is indeed unreadable, use `hdparm` to write to that sector: |
| | 196 | |
| | 197 | {{{ |
| | 198 | # hdparm --write-sector 16782858 /dev/sda |