![诊断不可写硬盘](https://linux22.com/image/222540/%E8%AF%8A%E6%96%AD%E4%B8%8D%E5%8F%AF%E5%86%99%E7%A1%AC%E7%9B%98.png)
我目前正在处理一个无法写入的 HDD,但我不明白原因。以下是我观察到的有关该问题的情况:
运行只读基准测试效果很好;读取速度和访问时间看起来不错
运行写入基准测试不会产生结果并且似乎“挂起”
任何尝试写入磁盘的应用程序或进程都会挂起直至终止,包括尝试格式化磁盘时的 gparted。在格式化尝试期间的某个时刻,出现“写入 /dev/sda 期间出现输入/输出错误”。我看到的唯一其他明显的错误消息是
Buffer I/O logical block <some_number> lost during async write
有时在关机期间显示的类似内容。自检的 Smartctl 输出看起来很好,让我相信这可能不是物理问题
该命令
fdisk -l
为受影响的磁盘返回以下输出:
Device Start End Sectors Size Type
/dev/sda1 63 532542 532480 260M EFI System
/dev/sda2 532543 498340557 497808015 237,4G Microsoft basic data
/dev/sda5 498341888 1953519615 1455177728 693,9G Linux filesystem
Partition 1 does not start on physical sector boundary.
Partition 2 does not start on physical sector boundary.
GPT PMBR size mismatch (4100491 != 15701758) will be corrected by write.
The backup GPT table is not on the end of the device. This problem will be corrected by write.
- 刚才我确实听到磁盘里传来一些类似刮擦的声音。
因此,特别是由于第 6 点,我假设 HDD 中存在物理损坏,但话又说回来,我希望 smartctl 能够指出这一点。不幸的是,我对此类问题缺乏经验,因此,如果有人知道我可以采取任何其他诊断步骤来确认磁盘确实已损坏,我将不胜感激。
\dmesg
编辑:根据要求,我在此处添加运行写入基准测试时的输出。基准测试本身停留在第一个样本上,如下所示。
[ 1090.321553] ata5.00: exception Emask 0x0 SAct 0x9801ffff SErr 0x50000 action 0x6 frozen
[ 1090.321562] ata5: SError: { PHYRdyChg CommWake }
[ 1090.321569] ata5.00: failed command: WRITE FPDMA QUEUED
[ 1090.321580] ata5.00: cmd 61/d0:00:40:0d:00/02:00:00:00:00/40 tag 0 ncq dma 368640 out
res 40/00:ff:ff:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
[ 1090.321584] ata5.00: status: { DRDY }
[ 1090.321588] ata5.00: failed command: WRITE FPDMA QUEUED
[ 1090.321598] ata5.00: cmd 61/40:08:10:10:00/05:00:00:00:00/40 tag 1 ncq dma 688128 out
res 40/00:ff:ff:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
[ 1090.321602] ata5.00: status: { DRDY }
[ 1090.321605] ata5.00: failed command: WRITE FPDMA QUEUED
[ 1090.321614] ata5.00: cmd 61/c8:10:50:15:00/02:00:00:00:00/40 tag 2 ncq dma 364544 out
res 40/00:ff:ff:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
[ 1090.321618] ata5.00: status: { DRDY }
[ 1090.321622] ata5.00: failed command: WRITE FPDMA QUEUED
[ 1090.321630] ata5.00: cmd 61/48:18:18:18:00/05:00:00:00:00/40 tag 3 ncq dma 692224 out
res 40/00:ff:ff:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
[ 1090.321634] ata5.00: status: { DRDY }
[ 1090.321638] ata5.00: failed command: WRITE FPDMA QUEUED
[ 1090.321646] ata5.00: cmd 61/c0:20:60:1d:00/02:00:00:00:00/40 tag 4 ncq dma 360448 out
res 40/00:ff:ff:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
[ 1090.321650] ata5.00: status: { DRDY }
[ 1090.321654] ata5.00: failed command: WRITE FPDMA QUEUED
[ 1090.321662] ata5.00: cmd 61/48:28:20:20:00/05:00:00:00:00/40 tag 5 ncq dma 692224 out
res 40/00:ff:ff:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
[ 1090.321666] ata5.00: status: { DRDY }
[ 1090.321670] ata5.00: failed command: WRITE FPDMA QUEUED
[ 1090.321678] ata5.00: cmd 61/c0:30:68:25:00/02:00:00:00:00/40 tag 6 ncq dma 360448 out
res 40/00:ff:ff:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
[ 1090.321682] ata5.00: status: { DRDY }
[ 1090.321686] ata5.00: failed command: WRITE FPDMA QUEUED
[ 1090.321694] ata5.00: cmd 61/40:38:28:28:00/05:00:00:00:00/40 tag 7 ncq dma 688128 out
res 40/00:ff:ff:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
[ 1090.321698] ata5.00: status: { DRDY }
[ 1090.321701] ata5.00: failed command: WRITE FPDMA QUEUED
[ 1090.321710] ata5.00: cmd 61/c0:40:68:2d:00/02:00:00:00:00/40 tag 8 ncq dma 360448 out
res 40/00:ff:ff:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
[ 1090.321714] ata5.00: status: { DRDY }
[ 1090.321717] ata5.00: failed command: WRITE FPDMA QUEUED
[ 1090.321726] ata5.00: cmd 61/40:48:28:30:00/05:00:00:00:00/40 tag 9 ncq dma 688128 out
res 40/00:ff:ff:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
[ 1090.321730] ata5.00: status: { DRDY }
[ 1090.321733] ata5.00: failed command: WRITE FPDMA QUEUED
[ 1090.321742] ata5.00: cmd 61/c8:50:68:35:00/02:00:00:00:00/40 tag 10 ncq dma 364544 out
res 40/00:ff:ff:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
[ 1090.321746] ata5.00: status: { DRDY }
[ 1090.321749] ata5.00: failed command: WRITE FPDMA QUEUED
[ 1090.321758] ata5.00: cmd 61/40:58:30:38:00/05:00:00:00:00/40 tag 11 ncq dma 688128 out
res 40/00:ff:ff:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
[ 1090.321762] ata5.00: status: { DRDY }
[ 1090.321765] ata5.00: failed command: WRITE FPDMA QUEUED
[ 1090.321774] ata5.00: cmd 61/c0:60:70:3d:00/02:00:00:00:00/40 tag 12 ncq dma 360448 out
res 40/00:ff:ff:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
[ 1090.321778] ata5.00: status: { DRDY }
[ 1090.321781] ata5.00: failed command: WRITE FPDMA QUEUED
[ 1090.321790] ata5.00: cmd 61/40:68:30:40:00/05:00:00:00:00/40 tag 13 ncq dma 688128 out
res 40/00:ff:ff:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
[ 1090.321794] ata5.00: status: { DRDY }
[ 1090.321797] ata5.00: failed command: WRITE FPDMA QUEUED
[ 1090.321806] ata5.00: cmd 61/c8:70:70:45:00/02:00:00:00:00/40 tag 14 ncq dma 364544 out
res 40/00:ff:ff:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
[ 1090.321810] ata5.00: status: { DRDY }
[ 1090.321813] ata5.00: failed command: WRITE FPDMA QUEUED
[ 1090.321822] ata5.00: cmd 61/48:78:38:48:00/05:00:00:00:00/40 tag 15 ncq dma 692224 out
res 40/00:01:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
[ 1090.321826] ata5.00: status: { DRDY }
[ 1090.321829] ata5.00: failed command: WRITE FPDMA QUEUED
[ 1090.321838] ata5.00: cmd 61/80:80:80:4d:00/02:00:00:00:00/40 tag 16 ncq dma 327680 out
res 40/00:ff:ff:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
[ 1090.321841] ata5.00: status: { DRDY }
[ 1090.321845] ata5.00: failed command: WRITE FPDMA QUEUED
[ 1090.321854] ata5.00: cmd 61/40:d8:00:00:00/05:00:00:00:00/40 tag 27 ncq dma 688128 out
res 40/00:01:00:4f:c2/00:00:00:00:00/00 Emask 0x4 (timeout)
[ 1090.321858] ata5.00: status: { DRDY }
[ 1090.321861] ata5.00: failed command: WRITE FPDMA QUEUED
[ 1090.321870] ata5.00: cmd 61/c0:e0:40:05:00/02:00:00:00:00/40 tag 28 ncq dma 360448 out
res 40/00:00:00:4f:c2/00:00:00:00:00/00 Emask 0x4 (timeout)
[ 1090.321874] ata5.00: status: { DRDY }
[ 1090.321877] ata5.00: failed command: WRITE FPDMA QUEUED
[ 1090.321886] ata5.00: cmd 61/40:f8:00:08:00/05:00:00:00:00/40 tag 31 ncq dma 688128 out
res 40/00:ff:ff:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
[ 1090.321890] ata5.00: status: { DRDY }
[ 1090.321896] ata5: hard resetting link
[ 1090.636674] ata5: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
[ 1090.646800] ata5.00: ACPI cmd ef/10:06:00:00:00:00 (SET FEATURES) succeeded
[ 1090.646806] ata5.00: ACPI cmd f5/00:00:00:00:00:00 (SECURITY FREEZE LOCK) filtered out
[ 1090.646811] ata5.00: ACPI cmd b1/c1:00:00:00:00:00 (DEVICE CONFIGURATION OVERLAY) filtered out
[ 1090.651025] ata5.00: ACPI cmd ef/10:06:00:00:00:00 (SET FEATURES) succeeded
[ 1090.651032] ata5.00: ACPI cmd f5/00:00:00:00:00:00 (SECURITY FREEZE LOCK) filtered out
[ 1090.651036] ata5.00: ACPI cmd b1/c1:00:00:00:00:00 (DEVICE CONFIGURATION OVERLAY) filtered out
[ 1090.652207] ata5.00: configured for UDMA/100
[ 1090.652755] ata5: EH complete
[ 1121.030386] ata5.00: exception Emask 0x0 SAct 0xfcfffc SErr 0x40000 action 0x6 frozen
[ 1121.030399] ata5: SError: { CommWake }
[ 1121.030408] ata5.00: failed command: WRITE FPDMA QUEUED
[ 1121.030425] ata5.00: cmd 61/40:10:00:08:00/05:00:00:00:00/40 tag 2 ncq dma 688128 out
res 40/00:ff:ff:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
[ 1121.030430] ata5.00: status: { DRDY }
[ 1121.030436] ata5.00: failed command: WRITE FPDMA QUEUED
[ 1121.030451] ata5.00: cmd 61/c0:18:40:05:00/02:00:00:00:00/40 tag 3 ncq dma 360448 out
res 40/00:ff:ff:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
[ 1121.030457] ata5.00: status: { DRDY }
[ 1121.030462] ata5.00: failed command: WRITE FPDMA QUEUED
[ 1121.030471] ata5.00: cmd 61/40:20:00:00:00/05:00:00:00:00/40 tag 4 ncq dma 688128 out
res 40/00:ff:ff:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
[ 1121.030475] ata5.00: status: { DRDY }
[ 1121.030479] ata5.00: failed command: WRITE FPDMA QUEUED
[ 1121.030488] ata5.00: cmd 61/80:28:80:4d:00/02:00:00:00:00/40 tag 5 ncq dma 327680 out
res 40/00:ff:ff:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
[ 1121.030491] ata5.00: status: { DRDY }
[ 1121.030495] ata5.00: failed command: WRITE FPDMA QUEUED
[ 1121.030504] ata5.00: cmd 61/48:30:38:48:00/05:00:00:00:00/40 tag 6 ncq dma 692224 out
res 40/00:ff:ff:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
[ 1121.030507] ata5.00: status: { DRDY }
[ 1121.030511] ata5.00: failed command: WRITE FPDMA QUEUED
[ 1121.030520] ata5.00: cmd 61/c8:38:70:45:00/02:00:00:00:00/40 tag 7 ncq dma 364544 out
res 40/00:ff:ff:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
[ 1121.030523] ata5.00: status: { DRDY }
[ 1121.030527] ata5.00: failed command: WRITE FPDMA QUEUED
[ 1121.030535] ata5.00: cmd 61/40:40:30:40:00/05:00:00:00:00/40 tag 8 ncq dma 688128 out
res 40/00:ff:ff:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
[ 1121.030539] ata5.00: status: { DRDY }
[ 1121.030543] ata5.00: failed command: WRITE FPDMA QUEUED
[ 1121.030551] ata5.00: cmd 61/c0:48:70:3d:00/02:00:00:00:00/40 tag 9 ncq dma 360448 out
res 40/00:ff:ff:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
[ 1121.030555] ata5.00: status: { DRDY }
[ 1121.030558] ata5.00: failed command: WRITE FPDMA QUEUED
[ 1121.030568] ata5.00: cmd 61/40:50:30:38:00/05:00:00:00:00/40 tag 10 ncq dma 688128 out
res 40/00:ff:ff:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
[ 1121.030571] ata5.00: status: { DRDY }
[ 1121.030575] ata5.00: failed command: WRITE FPDMA QUEUED
[ 1121.030584] ata5.00: cmd 61/c8:58:68:35:00/02:00:00:00:00/40 tag 11 ncq dma 364544 out
res 40/00:ff:ff:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
[ 1121.030587] ata5.00: status: { DRDY }
[ 1121.030591] ata5.00: failed command: WRITE FPDMA QUEUED
[ 1121.030600] ata5.00: cmd 61/40:60:28:30:00/05:00:00:00:00/40 tag 12 ncq dma 688128 out
res 40/00:ff:ff:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
[ 1121.030603] ata5.00: status: { DRDY }
[ 1121.030607] ata5.00: failed command: WRITE FPDMA QUEUED
[ 1121.030616] ata5.00: cmd 61/c0:68:68:2d:00/02:00:00:00:00/40 tag 13 ncq dma 360448 out
res 40/00:ff:ff:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
[ 1121.030619] ata5.00: status: { DRDY }
[ 1121.030623] ata5.00: failed command: WRITE FPDMA QUEUED
[ 1121.030632] ata5.00: cmd 61/40:70:28:28:00/05:00:00:00:00/40 tag 14 ncq dma 688128 out
res 40/00:ff:ff:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
[ 1121.030635] ata5.00: status: { DRDY }
[ 1121.030639] ata5.00: failed command: WRITE FPDMA QUEUED
[ 1121.030648] ata5.00: cmd 61/c0:78:68:25:00/02:00:00:00:00/40 tag 15 ncq dma 360448 out
res 40/00:01:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
[ 1121.030651] ata5.00: status: { DRDY }
[ 1121.030655] ata5.00: failed command: WRITE FPDMA QUEUED
[ 1121.030664] ata5.00: cmd 61/48:90:20:20:00/05:00:00:00:00/40 tag 18 ncq dma 692224 out
res 40/00:ff:ff:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
[ 1121.030667] ata5.00: status: { DRDY }
[ 1121.030671] ata5.00: failed command: WRITE FPDMA QUEUED
[ 1121.030680] ata5.00: cmd 61/c0:98:60:1d:00/02:00:00:00:00/40 tag 19 ncq dma 360448 out
res 40/00:ff:ff:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
[ 1121.030683] ata5.00: status: { DRDY }
[ 1121.030687] ata5.00: failed command: WRITE FPDMA QUEUED
[ 1121.030696] ata5.00: cmd 61/48:a0:18:18:00/05:00:00:00:00/40 tag 20 ncq dma 692224 out
res 40/00:01:00:4f:c2/00:00:00:00:00/00 Emask 0x4 (timeout)
[ 1121.030699] ata5.00: status: { DRDY }
[ 1121.030703] ata5.00: failed command: WRITE FPDMA QUEUED
[ 1121.030712] ata5.00: cmd 61/c8:a8:50:15:00/02:00:00:00:00/40 tag 21 ncq dma 364544 out
res 40/00:ff:ff:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
[ 1121.030715] ata5.00: status: { DRDY }
[ 1121.030719] ata5.00: failed command: WRITE FPDMA QUEUED
[ 1121.030728] ata5.00: cmd 61/40:b0:10:10:00/05:00:00:00:00/40 tag 22 ncq dma 688128 out
res 40/00:00:00:4f:c2/00:00:00:00:00/00 Emask 0x4 (timeout)
[ 1121.030731] ata5.00: status: { DRDY }
[ 1121.030735] ata5.00: failed command: WRITE FPDMA QUEUED
[ 1121.030743] ata5.00: cmd 61/d0:b8:40:0d:00/02:00:00:00:00/40 tag 23 ncq dma 368640 out
res 40/00:00:00:4f:c2/00:00:00:00:00/00 Emask 0x4 (timeout)
[ 1121.030747] ata5.00: status: { DRDY }
[ 1121.030753] ata5: hard resetting link
[ 1121.345937] ata5: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
[ 1121.358873] ata5.00: ACPI cmd ef/10:06:00:00:00:00 (SET FEATURES) succeeded
[ 1121.358880] ata5.00: ACPI cmd f5/00:00:00:00:00:00 (SECURITY FREEZE LOCK) filtered out
[ 1121.358884] ata5.00: ACPI cmd b1/c1:00:00:00:00:00 (DEVICE CONFIGURATION OVERLAY) filtered out
[ 1121.363203] ata5.00: ACPI cmd ef/10:06:00:00:00:00 (SET FEATURES) succeeded
[ 1121.363209] ata5.00: ACPI cmd f5/00:00:00:00:00:00 (SECURITY FREEZE LOCK) filtered out
[ 1121.363214] ata5.00: ACPI cmd b1/c1:00:00:00:00:00 (DEVICE CONFIGURATION OVERLAY) filtered out
[ 1121.364412] ata5.00: configured for UDMA/100
[ 1121.364968] ata5: EH complete
[ 1209.075840] INFO: task gnome-disks:8463 blocked for more than 120 seconds.
[ 1209.075852] Tainted: P OE 5.4.0-153-generic #170-Ubuntu
[ 1209.075854] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[ 1209.075858] gnome-disks D 0 8463 2344 0x00004000
[ 1209.075863] Call Trace:
[ 1209.075878] __schedule+0x2e3/0x740
[ 1209.075885] schedule+0x42/0xb0
[ 1209.075891] io_schedule+0x16/0x40
[ 1209.075899] __blkdev_direct_IO+0x353/0x450
[ 1209.075906] ? check_preempt_curr+0x4e/0x90
[ 1209.075911] blkdev_direct_IO+0x4d/0x70
[ 1209.075919] generic_file_direct_write+0x9c/0x170
[ 1209.075926] __generic_file_write_iter+0xbc/0x1d0
[ 1209.075931] blkdev_write_iter+0xb8/0x160
[ 1209.075940] new_sync_write+0x125/0x1c0
[ 1209.075949] __vfs_write+0x29/0x40
[ 1209.075952] vfs_write+0xb9/0x1a0
[ 1209.075957] ksys_write+0x67/0xe0
[ 1209.075962] __x64_sys_write+0x1a/0x20
[ 1209.075975] do_syscall_64+0x57/0x190
[ 1209.075980] entry_SYSCALL_64_after_hwframe+0x5c/0xc1
[ 1209.075984] RIP: 0033:0x7efc3d2f132f
[ 1209.075992] Code: Bad RIP value.
[ 1209.075995] RSP: 002b:00007efc32dc59a0 EFLAGS: 00000293 ORIG_RAX: 0000000000000001
[ 1209.075999] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007efc3d2f132f
[ 1209.076002] RDX: 0000000000a00000 RSI: 00007efc313c4000 RDI: 000000000000000b
[ 1209.076004] RBP: 000055a1a5d5d010 R08: 0000000000000000 R09: 0000000000000423
[ 1209.076005] R10: 00007ffdf2cc2090 R11: 0000000000000293 R12: 000000000000000b
[ 1209.076007] R13: 00007efc313c4000 R14: 0000000000001000 R15: 00007efc32dc5a50
[ 1213.183836] ata5.00: exception Emask 0x0 SAct 0x0 SErr 0x40000 action 0x6 frozen
[ 1213.183845] ata5: SError: { CommWake }
[ 1213.183852] ata5.00: failed command: WRITE DMA EXT
[ 1213.183865] ata5.00: cmd 35/00:c8:68:35:00/00:02:00:00:00/e0 tag 17 dma 364544 out
res 40/00:ff:ff:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
[ 1213.183869] ata5.00: status: { DRDY }
[ 1213.183876] ata5: hard resetting link
[ 1213.498788] ata5: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
[ 1213.501523] ata5.00: ACPI cmd ef/10:06:00:00:00:00 (SET FEATURES) succeeded
[ 1213.501530] ata5.00: ACPI cmd f5/00:00:00:00:00:00 (SECURITY FREEZE LOCK) filtered out
[ 1213.501534] ata5.00: ACPI cmd b1/c1:00:00:00:00:00 (DEVICE CONFIGURATION OVERLAY) filtered out
[ 1213.505634] ata5.00: ACPI cmd ef/10:06:00:00:00:00 (SET FEATURES) succeeded
[ 1213.505640] ata5.00: ACPI cmd f5/00:00:00:00:00:00 (SECURITY FREEZE LOCK) filtered out
[ 1213.505645] ata5.00: ACPI cmd b1/c1:00:00:00:00:00 (DEVICE CONFIGURATION OVERLAY) filtered out
[ 1213.506879] ata5.00: configured for UDMA/100
[ 1213.507257] ata5: EH complete
答案1
从上面的
dmesg
输出可以清楚地看出,该硬盘已损坏且无法修复(软件方面)。假设您需要其中的数据,我建议您现在停止摆弄它。
如果您确实需要其中的数据,请联系一些信誉良好的恢复公司,并做好准备,这可能会花费一大笔钱。
如果您不需要其中的数据,请将其扔到垃圾场。
我希望我确实让你的决定变得更清楚了。