经过几个挂起/恢复周期后,我的硬盘之一从设备列表中消失,以下是dmesg
似乎与问题相关的输出的一部分:
[ 450.005310] sd 5:0:0:0: [sdc] Starting disk
[ 451.754602] ata6.00: detaching (SCSI 5:0:0:0)
[ 451.755862] sd 5:0:0:0: [sdc] Stopping disk
[ 451.993621] ata6: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
[ 451.993682] sd 5:0:0:0: [sdc] Start/Stop Unit failed: Result: hostbyte=0x04 driverbyte=0x00
设备本身应该没问题,Ubuntu 在那里工作了几周,在其他驱动器上安装 Gentoo 并将其用作存储后出现问题。看起来内核中的设备初始化过程有一些超时,这对于这个慢速磁盘来说还不够。
使用 2 个不同的内核重现了该问题:从 gentoo-sources 包构建的 4.1.15、4.4.1。
Linux 发行版:Gentoo
更新:
丢失磁盘后尝试重新扫描
echo "- - -" > /sys/class/scsi_host/host5/scan
我的磁盘又回来了
[ 1517.414376] ata6: hard resetting link
[ 1517.718490] ata6: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
[ 1517.722674] ata6.00: ACPI cmd ef/02:00:00:00:00:a0 (SET FEATURES) succeeded
[ 1517.722677] ata6.00: ACPI cmd f5/00:00:00:00:00:a0 (SECURITY FREEZE LOCK) filtered out
[ 1518.140312] ata6.00: ATA-8: TOSHIBA MQ01ABD100, AX0P8E, max UDMA/100
[ 1518.140316] ata6.00: 1953525168 sectors, multi 16: LBA48 NCQ (depth 31/32), AA
[ 1518.142307] ata6.00: ACPI cmd ef/02:00:00:00:00:a0 (SET FEATURES) succeeded
[ 1518.142310] ata6.00: ACPI cmd f5/00:00:00:00:00:a0 (SECURITY FREEZE LOCK) filtered out
[ 1518.143854] ata6.00: configured for UDMA/100
[ 1518.143861] ata6: EH complete
[ 1518.144170] scsi 5:0:0:0: Direct-Access ATA TOSHIBA MQ01ABD1 8E PQ: 0 ANSI: 5
[ 1518.144301] sd 5:0:0:0: [sdc] 1953525168 512-byte logical blocks: (1.00 TB/931 GiB)
[ 1518.144304] sd 5:0:0:0: [sdc] 4096-byte physical blocks
[ 1518.144334] sd 5:0:0:0: Attached scsi generic sg2 type 0
[ 1518.144350] sd 5:0:0:0: [sdc] Write Protect is off
[ 1518.144354] sd 5:0:0:0: [sdc] Mode Sense: 00 3a 00 00
[ 1518.144387] sd 5:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 1518.175044] sdc: sdc1
[ 1518.175497] sd 5:0:0:0: [sdc] Attached SCSI removable disk
所以至少我有解决方法,仍然希望找到更好的解决方案。
答案1
我不知道 ubuntu 内核中使用了哪些神奇补丁(或者可能是 gentoo-sources 中的某些内容,或者我的内核配置有问题),但是在切换到 ubuntu 16.04(内核 4.4.0-11-generic)后我的问题消失了)。