我有一个数据库备份脚本,它执行 mysqldump 并将转储复制到带有 XFS 分区的外部硬盘驱动器。不幸的是,在复制过程中,驱动器卸载,设备从 /dev/sdc 更改为 /dev/sdd。/dev/sdc1 仍将被挂载,但挂载它的文件夹不可访问。我卸载驱动器,这时 /dev/sdd(或它决定的任何驱动器)出现。我挂载它,它工作正常。
备份脚本运行时的 dmesg 输出如下所示:
[328722.136119] usb 2-1: USB disconnect, address 69
[328722.172828] xfs_force_shutdown(sdc1,0x1) called from line 335 of file /build/buildd/linux-2.6.32/fs/xfs/xfs_rw.c. Return address = 0xffffffffa030f9d3
[328722.172845] Filesystem "sdc1": I/O Error Detected. Shutting down filesystem: sdc1
[328722.181694] Please umount the filesystem, and rectify the problem(s)
[328722.186817] xfs_force_shutdown(sdc1,0x1) called from line 335 of file /build/buildd/linux-2.6.32/fs/xfs/xfs_rw.c. Return address = 0xffffffffa030f9d3
[328722.172845] Filesystem "sdc1": I/O Error Detected. Shutting down filesystem : sdc1
[328722.181694] Please umount the filesystem, and rectify the problem(s)
[328722.186817] xfs_force_shutdown(sdc1,0x1) called from line 335 of file /build/buildd/linux-2.6.32/fs/xfs/xfs_rw.c. Return address = 0xffffffffa030f9d3
[328734.520107] usb 2-1: new high speed USB device using ehci_hcd and address 70
[328734.675122] usb 2-1: configuration #1 chosen from 1 choice
[328734.675493] scsi322 : SCSI emulation for USB Mass Storage devices
[328734.675693] usb-storage: device found at 70
[328734.675697] usb-storage: waiting for device to settle before scanning
[328739.670293] usb-storage: device scan complete
[328739.672217] scsi 322:0:0:0: Direct-Access Seagate Desktop 0130
PQ: 0 ANSI: 4
我对磁盘进行了一些文件系统检查,结果似乎正常。我也用磁盘做了其他事情,它也能正常工作。似乎发生了这种情况每一个我运行备份脚本的时间。
答案1
嗯,日志中显示:USB 断开连接。如果备份脚本导致大量活动,则可能是电缆/连接器松动,或者 USB 端口电流过大。
如果您想绝对确定它与文件系统类型无关,您可以重新格式化外部驱动器并查看它在 ext4/3、NTFS 或 VFAT 下的表现。