禁用坏磁盘垃圾邮件 dmesg/journalctl

禁用坏磁盘垃圾邮件 dmesg/journalctl

是否可以使用命令行禁用磁盘?我收到这样的垃圾邮件:

[2245922.091035] ata3: EH complete
[2245922.150696] ata3.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
[2245922.150701] ata3.00: irq_stat 0x40000001
[2245922.150703] ata3.00: failed command: FLUSH CACHE EXT
[2245922.150704] ata3.00: cmd ea/00:00:00:00:00/00:00:00:00:00/a0 tag 18
                          res 71/04:00:00:00:00/00:00:00:00:00/a0 Emask 0x1 (device error)
[2245922.150708] ata3.00: status: { DRDY DF ERR }
[2245922.150709] ata3.00: error: { ABRT }
[2245922.151027] ata3.00: configured for UDMA/33
[2245922.151030] ata3.00: device reported invalid CHS sector 0
[2245922.151034] ata3: EH complete
[2245922.238686] ata3.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
[2245922.238692] ata3.00: irq_stat 0x40000001
[2245922.238696] ata3.00: failed command: FLUSH CACHE EXT
[2245922.238697] ata3.00: cmd ea/00:00:00:00:00/00:00:00:00:00/a0 tag 24
                          res 71/04:00:00:00:00/00:00:00:00:00/a0 Emask 0x1 (device error)
[2245922.238701] ata3.00: status: { DRDY DF ERR }
[2245922.238702] ata3.00: error: { ABRT }
[2245922.239043] ata3.00: configured for UDMA/33
[2245922.239047] ata3.00: device reported invalid CHS sector 0
[2245922.239053] sd 2:0:0:0: [sdd] tag#24 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=0s
[2245922.239056] sd 2:0:0:0: [sdd] tag#24 Sense Key : Illegal Request [current]
[2245922.239058] sd 2:0:0:0: [sdd] tag#24 Add. Sense: Unaligned write command
[2245922.239060] sd 2:0:0:0: [sdd] tag#24 CDB: Synchronize Cache(10) 35 00 00 00 00 00 00 00 00 00
[2245922.239063] I/O error, dev sdd, sector 0 op 0x1:(WRITE) flags 0x800 phys_seg 0 prio class 3

有问题的磁盘未安装且已从中删除/etc/fstab

sdd             8:48   0 223.6G  0 disk
├─sdd1          8:49   0   1.9G  0 part
├─sdd2          8:50   0     1K  0 part
└─sdd5          8:53   0 221.7G  0 part

# 256GB GALAX SSD
#UUID=48c76170-0392-44ce-a8c6-f790673c8f32 /media/asd/galax250 ext4 noatime,user 0 0

由于我仍在使用电脑,所以没有重新启动。它让一切都有点滞后。

影驰固态硬盘

答案1

代码片段中的最后一行dmesg表明写入操作失败。

你可以试试:

echo 1 | sudo tee /sys/block/sdd/device/delete

由于写缓存,将数据发送到磁盘的应用程序已经“承诺”数据与写入一样好,并且内核绝对会尽力遵守这个承诺。因此,只要磁盘看起来可用,内核就会继续尝试写入数据。该命令告诉内核准备磁盘以进行热拔出。如果它有效,/dev/sdd将会消失,并且内核可能会尝试使磁盘旋转(如果可能)。

(如果有人知道如何明确地告诉 Linux 内核“我命令你丢失所有缓存的写操作到此磁盘”,请随意写下您自己的答案或将其编辑到此磁盘中。)

相关内容