为什么我的拇指驱动器在一段时间后会进入只读模式?

为什么我的拇指驱动器在一段时间后会进入只读模式?

我的拇指驱动器自动安装为读写,我通过写入文件来测试它。

然后 18 小时后,我运行了一个 cron 作业

cp -f -u $i "$TARG"/$i

我收到消息,

cp: cannot remove `/media/HP USB FD/./bin_backup.zip': Read-only file system

为什么它变成了只读?我正在运行 Fedora 16,这以前曾有效过;我不确定是什么改变了它停止工作(尽管我确实旋转拇指驱动器)。

一段时间后,我在 dmesg 日志中看到以下内容:

(tl;博士总结 - 中间写着,[3866698.685131] FAT-fs (sdb1): Filesystem has been set read-only

[3807719.969704]  sdb: sdb1
[3807719.984477] sd 18:0:0:0: [sdb] Attached SCSI removable disk
[3865771.716500] swapper/0: page allocation failure: order:2, mode:0x4020
[3865771.716506] Pid: 0, comm: swapper/0 Not tainted 3.2.9-2.fc16.x86_64 #1
[3865771.716508] Call Trace:
[3865771.716510]  <IRQ>  [<ffffffff8111fd66>] warn_alloc_failed+0xf6/0x160
[3865771.716524]  [<ffffffff8112d241>] ? wakeup_kswapd+0x101/0x160
[3865771.716529]  [<ffffffff81123c59>] __alloc_pages_nodemask+0x6f9/0x8c0
[3865771.716536]  [<ffffffff815dc633>] kmalloc_large_node+0x57/0x85
[3865771.716541]  [<ffffffff81168e7c>] __kmalloc_node_track_caller+0x19c/0x1f0
[3865771.716546]  [<ffffffff814c813b>] ? __alloc_skb+0x4b/0x240
[3865771.716549]  [<ffffffff814c8955>] ? skb_copy+0x45/0xb0
[3865771.716553]  [<ffffffff814c8168>] __alloc_skb+0x78/0x240
[3865771.716556]  [<ffffffff814c8955>] skb_copy+0x45/0xb0
[3865771.716576]  [<ffffffffa017a9a4>] tg3_start_xmit+0xa34/0xc80 [tg3]
[3865771.716583]  [<ffffffff814d7282>] dev_hard_start_xmit+0x322/0x6e0
[3865771.716590]  [<ffffffff814f2daf>] sch_direct_xmit+0xef/0x1c0
[3865771.716595]  [<ffffffff814d77c4>] dev_queue_xmit+0x184/0x600
[3865771.716600]  [<ffffffff81500985>] ? nf_hook_slow+0x75/0x150
[3865771.716605]  [<ffffffff8150f8d0>] ? ip_fragment+0x810/0x810
[3865771.716609]  [<ffffffff8150fa3b>] ip_finish_output+0x16b/0x2f0
[3865771.716613]  [<ffffffff81510598>] ip_output+0x98/0xa0
[3865771.716617]  [<ffffffff8150fc64>] ? __ip_local_out+0xa4/0xb0
[3865771.716621]  [<ffffffff8150fc99>] ip_local_out+0x29/0x30
[3865771.716626]  [<ffffffff8150fdef>] ip_queue_xmit+0x14f/0x3f0
[3865771.716630]  [<ffffffff81527204>] tcp_transmit_skb+0x3e4/0x8d0
[3865771.716634]  [<ffffffff81527d57>] tcp_write_xmit+0xf7/0xa20
[3865771.716638]  [<ffffffff8152a9f0>] ? tcp_v4_md5_lookup+0x10/0x20
[3865771.716643]  [<ffffffff815286e6>] __tcp_push_pending_frames+0x26/0xd0
[3865771.716647]  [<ffffffff81524e0d>] tcp_rcv_established+0x10d/0x8b0
[3865771.716651]  [<ffffffff8152d09f>] tcp_v4_do_rcv+0x27f/0x430
[3865771.716656]  [<ffffffff8152ee70>] tcp_v4_rcv+0x610/0x8e0
[3865771.716660]  [<ffffffff8150acf0>] ? ip_rcv_finish+0x380/0x380
[3865771.716663]  [<ffffffff8150acf0>] ? ip_rcv_finish+0x380/0x380
[3865771.716668]  [<ffffffff8150adcd>] ip_local_deliver_finish+0xdd/0x280
[3865771.716672]  [<ffffffff8150b138>] ip_local_deliver+0x88/0x90
[3865771.716676]  [<ffffffff8150aaa1>] ip_rcv_finish+0x131/0x380
[3865771.716680]  [<ffffffff8150b375>] ip_rcv+0x235/0x300
[3865771.716685]  [<ffffffff814d4e23>] __netif_receive_skb+0x523/0x5c0
[3865771.716690]  [<ffffffff814d5a20>] netif_receive_skb+0x80/0x90
[3865771.716694]  [<ffffffff814d5d89>] ? dev_gro_receive+0x1b9/0x2c0
[3865771.716699]  [<ffffffff814d5a80>] napi_skb_finish+0x50/0x70
[3865771.716703]  [<ffffffff814d5f85>] napi_gro_receive+0xf5/0x140
[3865771.716711]  [<ffffffffa0171362>] tg3_poll_work+0x7a2/0xce0 [tg3]
[3865771.716717]  [<ffffffff81056d45>] ? check_preempt_curr+0x75/0xa0
[3865771.716725]  [<ffffffffa017868f>] tg3_poll+0x6f/0x3c0 [tg3]
[3865771.716730]  [<ffffffff814d617b>] net_rx_action+0x12b/0x270
[3865771.716735]  [<ffffffff81096ebd>] ? sched_clock_cpu+0xbd/0x110
[3865771.716740]  [<ffffffff81075d58>] __do_softirq+0xb8/0x230
[3865771.716745]  [<ffffffff8109acc6>] ? do_timer+0x2d6/0x500
[3865771.716749]  [<ffffffff815ee8ec>] call_softirq+0x1c/0x30
[3865771.716754]  [<ffffffff810162f5>] do_softirq+0x65/0xa0
[3865771.716758]  [<ffffffff8107616e>] irq_exit+0x9e/0xc0
[3865771.716762]  [<ffffffff815ef1a3>] do_IRQ+0x63/0xe0
[3865771.716766]  [<ffffffff815e4aee>] common_interrupt+0x6e/0x6e
[3865771.716768]  <EOI>  [<ffffffff81094189>] ? enqueue_hrtimer+0x39/0xc0
[3865771.716775]  [<ffffffff8131237d>] ? intel_idle+0xed/0x150
[3865771.716779]  [<ffffffff8131235f>] ? intel_idle+0xcf/0x150
[3865771.716784]  [<ffffffff81494fb1>] cpuidle_idle_call+0xc1/0x280
[3865771.716788]  [<ffffffff8101322a>] cpu_idle+0xca/0x120
[3865771.716792]  [<ffffffff815c199e>] rest_init+0x72/0x74
[3865771.716797]  [<ffffffff81aebbfe>] start_kernel+0x3ba/0x3c5
[3865771.716801]  [<ffffffff81aeb347>] x86_64_start_reservations+0x132/0x136
[3865771.716804]  [<ffffffff81aeb140>] ? early_idt_handlers+0x140/0x140
[3865771.716808]  [<ffffffff81aeb44d>] x86_64_start_kernel+0x102/0x111
[3866698.685128] FAT-fs (sdb1): error, fat_get_cluster: invalid cluster chain (i_pos 496175)
[3866698.685131] FAT-fs (sdb1): Filesystem has been set read-only
[3866698.685145] FAT-fs (sdb1): error, fat_get_cluster: invalid cluster chain (i_pos 496175)
[3866698.685148] FAT-fs (sdb1): error, fat_get_cluster: invalid cluster chain (i_pos 496175)
[3866698.685149] FAT-fs (sdb1): error, fat_get_cluster: invalid cluster chain (i_pos 496175)
[3866698.685151] FAT-fs (sdb1): error, fat_get_cluster: invalid cluster chain (i_pos 496175)
[3866698.685153] FAT-fs (sdb1): error, fat_get_cluster: invalid cluster chain (i_pos 496175)
[3866698.685154] FAT-fs (sdb1): error, fat_get_cluster: invalid cluster chain (i_pos 496175)
[3866698.685156] FAT-fs (sdb1): error, fat_get_cluster: invalid cluster chain (i_pos 496175)
[3866698.685158] FAT-fs (sdb1): error, fat_get_cluster: invalid cluster chain (i_pos 496175)
[3866698.685161] FAT-fs (sdb1): error, fat_get_cluster: invalid cluster chain (i_pos 496175)
[3953054.903337] fat_get_cluster: 88 callbacks suppressed
[3953054.903340] FAT-fs (sdb1): error, fat_get_cluster: invalid cluster chain (i_pos 496175)
[3953054.903356] FAT-fs (sdb1): error, fat_get_cluster: invalid cluster chain (i_pos 496175)
[3953054.903359] FAT-fs (sdb1): error, fat_get_cluster: invalid cluster chain (i_pos 496175)
[3953054.903362] FAT-fs (sdb1): error, fat_get_cluster: invalid cluster chain (i_pos 496175)
[3953054.903364] FAT-fs (sdb1): error, fat_get_cluster: invalid cluster chain (i_pos 496175)
[3953054.903367] FAT-fs (sdb1): error, fat_get_cluster: invalid cluster chain (i_pos 496175)
[3953054.903369] FAT-fs (sdb1): error, fat_get_cluster: invalid cluster chain (i_pos 496175)
[3953054.903371] FAT-fs (sdb1): error, fat_get_cluster: invalid cluster chain (i_pos 496175)
[3953054.903374] FAT-fs (sdb1): error, fat_get_cluster: invalid cluster chain (i_pos 496175)
[3953054.903378] FAT-fs (sdb1): error, fat_get_cluster: invalid cluster chain (i_pos 496175)

答案1

是只有一个驱动器,还是任何驱动器?

这可能不太可能,但如果驱动器上有 ext 文件系统并且使用该errors=remount-ro选项安装,那么拇指驱动器可能会开始抛出错误?

您可以使用 mount (如果使用了自定义安装选项)和une2fs (对于默认行为)检查错误行为。

$ mount | grep /dev/sda
/dev/sda2 on / type ext4 (rw,noatime,errors=remount-ro,discard)

$ sudo tune2fs -l /dev/sda2 | grep Errors
Errors behavior:          Continue

如果是这种情况并且驱动器开始抛出错误,则需要更换驱动器。

如果您想继续在读/写模式下使用驱动器(知道它可能在任何时候完全停止工作!),您可以更改错误模式以在发现错误时继续。执行此操作取决于错误模式的设置方式。首先(插入驱动器),更改磁盘分区本身的默认行为:

tune2fs -e continue /dev/sdb1

然后,如果仍在安装,请检查 /etc/fstab 并从相应的行中remount-ro删除该部分。errors=remount-ro但请注意,以只读模式重新安装对于在设备开始出现故障时通知您非常有用!

答案2

由于驱动程序崩溃,您的拇指驱动器变为只读。当驱动程序崩溃时,它可能想要写入的任何数据都可能已损坏,因此文件系统被迫进入只读模式以避免任何(进一步)损坏。

驱动程序因内存不足而崩溃:跟踪以 结尾warn_alloc_failed,内存不足由 表示swapper/0: page allocation failure: order:2, mode:0x4020。从表面上看,内核可用的内存似乎已经耗尽。这与耗尽 RAM 不太一样,因为内核无法自行使用整个 RAM。不过,内核内存耗尽的情况很少见。您是否正在运行导致大量同时磁盘使用或网络流量的密集型应用程序?您有大量视频内存吗?

如果答案是肯定的,您可能需要切换到 64 位安装,或者减少内核内存使用量。

如果答案是否定的(或者即使是肯定的),这可能是一个内核错误。确保您运行的是发行版提供的最新内核。这可能是由损坏的文件系统或损坏的读取器触发的驱动程序错误(驱动程序应该能够抵抗不良数据,但许多驱动程序没有针对行为不当的设备进行大量测试)。 RAM 也可能出现故障;做一个记忆测试

相关内容