我最近在将大量数据(通常大于 2 GB)从主硬盘复制到另一个安装在 /media 上的硬盘时遇到了一些问题。我尝试阅读一些帖子,但找不到答案。两个文件系统都是 EXT4 格式的,我不认为我的磁盘有问题,因为我最近更改了它以尝试找到解决方案。特别是复制过程停止,文件系统自动重新安装为只读,我收到“拼接文件错误:输入/输出”消息。
我的电脑运行的是 Ubuntu 16.04.4;我附上了 dmesg -H 输出的主要信息。你可以向我询问你需要的每一条信息。在此先感谢大家。
[mag13 17:27] EXT4-fs (sdb5): recovery complete
[ +0,019595] EXT4-fs (sdb5): mounted filesystem with ordered data mode. Opts: (null)
[ +46,651365] ata4.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen
[ +0,000011] ata4.00: failed command: WRITE DMA EXT
[ +0,000011] ata4.00: cmd 35/00:40:c0:6f:13/00:08:07:00:00/e0 tag 0 dma 1081344 out
res 40/00:00:00:4f:c2/00:00:00:00:00/00 Emask 0x4 (timeout)
[ +0,000006] ata4.00: status: { DRDY }
[ +5,018787] ata4: link is slow to respond, please be patient (ready=0)
[ +5,012363] ata4: device not ready (errno=-16), forcing hardreset
[ +0,000008] ata4: soft resetting link
[mag13 17:28] ata4: link is slow to respond, please be patient (ready=0)
[ +4,761904] ata4: SRST failed (errno=-16)
[ +0,000013] ata4: soft resetting link
[ +5,304651] ata4: link is slow to respond, please be patient (ready=0)
[ +4,743010] ata4: SRST failed (errno=-16)
[ +0,000014] ata4: soft resetting link
[ +5,306136] ata4: link is slow to respond, please be patient (ready=0)
[ +29,747233] ata4: SRST failed (errno=-16)
[ +0,000015] ata4: soft resetting link
[ +5,016536] ata4: SRST failed (errno=-16)
[ +0,010913] ata4: reset failed, giving up
[ +0,000008] ata4.00: disabled
[ +0,000019] ata4: EH complete
[ +0,000482] sd 3:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
[ +0,000006] sd 3:0:0:0: [sdb] tag#0 CDB: Write(10) 2a 00 07 13 6f c0 00 08 40 00
[ +0,000004] print_req_error: I/O error, dev sdb, sector 118714304
[ +0,000010] EXT4-fs warning (device sdb5): ext4_end_bio:322: I/O error 10 writing to inode 6160708 (offset 125829120 size 8388608 starting block 14839296)
[ +0,000004] Buffer I/O error on device sdb5, logical block 14838784
[ +0,000016] Buffer I/O error on device sdb5, logical block 14838785
[ +0,000006] Buffer I/O error on device sdb5, logical block 14838786
[ +0,000004] Buffer I/O error on device sdb5, logical block 14838787
[ +0,000004] Buffer I/O error on device sdb5, logical block 14838788
[ +0,000004] Buffer I/O error on device sdb5, logical block 14838789
[ +0,000005] Buffer I/O error on device sdb5, logical block 14838790
[ +0,000004] Buffer I/O error on device sdb5, logical block 14838791
[ +0,000004] Buffer I/O error on device sdb5, logical block 14838792
[ +0,000004] Buffer I/O error on device sdb5, logical block 14838793
[ +0,000219] EXT4-fs warning (device sdb5): ext4_end_bio:322: I/O error 10 writing to inode 6160708 (offset 125829120 size 8388608 starting block 14839552)
[ +0,000260] sd 3:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
[ +0,000025] sd 3:0:0:0: [sdb] tag#0 CDB: Write(10) 2a 00 07 13 78 00 00 08 00 00
[ +0,000003] print_req_error: I/O error, dev sdb, sector 118716416
[ +0,000010] EXT4-fs warning (device sdb5): ext4_end_bio:322: I/O error 10 writing to inode 6160708 (offset 125829120 size 8388608 starting block 14839808)
[ +0,000248] sd 3:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
[ +0,000021] sd 3:0:0:0: [sdb] tag#0 CDB: Read(10) 28 00 07 0f bc a8 00 00 20 00
[ +0,000012] print_req_error: I/O error, dev sdb, sector 118471848
[ +0,000102] sd 3:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
[ +0,000005] sd 3:0:0:0: [sdb] tag#0 CDB: Write(10) 2a 00 07 13 80 00 00 08 00 00
[ +0,000003] print_req_error: I/O error, dev sdb, sector 118718464
[ +0,000010] EXT4-fs warning (device sdb5): ext4_end_bio:322: I/O error 10 writing to inode 6160708 (offset 125829120 size 8388608 starting block 14840064)
[ +0,000370] sd 3:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
[ +0,000004] sd 3:0:0:0: [sdb] tag#0 CDB: Write(10) 2a 00 07 13 88 00 00 08 00 00
[ +0,000003] print_req_error: I/O error, dev sdb, sector 118720512
[ +0,000010] EXT4-fs warning (device sdb5): ext4_end_bio:322: I/O error 10 writing to inode 6160708 (offset 134217728 size 8388608 starting block 14840320)
[ +0,003481] sd 3:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
[ +0,000005] sd 3:0:0:0: [sdb] tag#0 CDB: Write(10) 2a 00 07 13 90 00 00 07 d0 00
[ +0,000003] print_req_error: I/O error, dev sdb, sector 118722560
[ +0,000039] sd 3:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
[ +0,000004] sd 3:0:0:0: [sdb] tag#0 CDB: Write(10) 2a 00 07 13 97 d0 00 00 30 00
[ +0,000003] print_req_error: I/O error, dev sdb, sector 118724560
[ +0,000007] EXT4-fs warning (device sdb5): ext4_end_bio:322: I/O error 10 writing to inode 6160708 (offset 134217728 size 8388608 starting block 14840576)
[ +0,000443] sd 3:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
[ +0,000004] sd 3:0:0:0: [sdb] tag#0 CDB: Write(10) 2a 00 07 13 98 00 00 06 08 00
[ +0,000003] print_req_error: I/O error, dev sdb, sector 118724608
[ +0,000036] sd 3:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
[ +0,000005] sd 3:0:0:0: [sdb] tag#0 CDB: Write(10) 2a 00 07 13 9e 08 00 01 f8 00
[ +0,000002] print_req_error: I/O error, dev sdb, sector 118726152
[ +0,000008] EXT4-fs warning (device sdb5): ext4_end_bio:322: I/O error 10 writing to inode 6160708 (offset 134217728 size 8388608 starting block 14840832)
[ +0,000383] sd 3:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
[ +0,000004] sd 3:0:0:0: [sdb] tag#0 CDB: Write(10) 2a 00 07 13 a0 00 00 07 80 00
[ +0,000003] print_req_error: I/O error, dev sdb, sector 118726656
[ +0,000034] EXT4-fs warning (device sdb5): ext4_end_bio:322: I/O error 10 writing to inode 6160708 (offset 134217728 size 8388608 starting block 14841088)
[ +0,000452] EXT4-fs warning (device sdb5): ext4_end_bio:322: I/O error 10 writing to inode 6160708 (offset 134217728 size 8388608 starting block 14841344)
[ +0,000433] EXT4-fs warning (device sdb5): ext4_end_bio:322: I/O error 10 writing to inode 6160708 (offset 134217728 size 8388608 starting block 14841600)
[ +0,057167] JBD2: Detected IO errors while flushing file data on sdb5-8
[ +0,016510] Aborting journal on device sdb5-8.
[ +0,000107] Buffer I/O error on dev sdb5, logical block 30441472, lost sync page write
[ +0,000393] JBD2: Error -5 detected when updating journal superblock for sdb5-8.
[ +0,000953] EXT4-fs error (device sdb5) in ext4_do_update_inode:5170: Journal has aborted
[ +0,000282] Buffer I/O error on dev sdb5, logical block 0, lost sync page write
[ +0,000030] EXT4-fs error (device sdb5): mpage_map_and_submit_extent:2566: comm kworker/u8:1: Failed to mark inode 6160708 dirty
[ +0,000008] EXT4-fs (sdb5): previous I/O error to superblock detected
[ +0,000292] Buffer I/O error on dev sdb5, logical block 0, lost sync page write
[ +0,000114] EXT4-fs error (device sdb5) in ext4_writepages:2904: IO failure
[ +0,000038] EXT4-fs (sdb5): previous I/O error to superblock detected
[ +0,000305] Buffer I/O error on dev sdb5, logical block 0, lost sync page write
[ +0,000177] EXT4-fs (sdb5): previous I/O error to superblock detected
[ +0,000454] Buffer I/O error on dev sdb5, logical block 0, lost sync page write
[ +0,000126] EXT4-fs error (device sdb5): ext4_journal_check_start:60: Detected aborted journal
[ +0,000006] EXT4-fs (sdb5): Remounting filesystem read-only
[ +0,000004] EXT4-fs (sdb5): previous I/O error to superblock detected
[ +0,000436] Buffer I/O error on dev sdb5, logical block 0, lost sync page write
[ +0,000159] EXT4-fs (sdb5): ext4_writepages: jbd2_start: 1024 pages, ino 6160708; err -30
[ +0,030339] JBD2: Detected IO errors while flushing file data on sdb5-8
df 输出:
Filesystem 1K-blocks Used Available Use% Mounted on
udev 1509968 0 1509968 0% /dev
tmpfs 307264 5176 302088 2% /run
/dev/sda1 237138624 55544428 169525128 25% /
tmpfs 1536316 26512 1509804 2% /dev/shm
tmpfs 5120 4 5116 1% /run/lock
tmpfs 1536316 0 1536316 0% /sys/fs/cgroup
/dev/loop0 163328 163328 0 100% /snap/spotify/5
/dev/loop2 88704 88704 0 100% /snap/core/4571
/dev/loop1 88704 88704 0 100% /snap/core/4486
/dev/loop3 139136 139136 0 100% /snap/shotcut/22
/dev/loop4 88704 88704 0 100% /snap/core/4407
/dev/loop5 130688 130688 0 100% /snap/shotcut/21
/dev/loop6 166528 166528 0 100% /snap/spotify/6
/dev/loop7 166016 166016 0 100% /snap/spotify/13
tmpfs 307264 136 307128 1% /run/user/1000
/dev/sdb5 240229888 77729508 150274284 35% /media/lorenzo/ExternalDrive
答案1
损坏的文件系统与文件传输问题有关。这可能是原因,也可能是症状。无论如何,文件系统应该卸载并用 修复
fsck -f
。要检查无法卸载的文件系统,请使用sudo touch /forcefsck
并重新启动。源驱动器可能出现故障或扇区损坏。大型文件更容易出现问题,因为它们跨越的扇区数量更多。除非您有备份,否则坏扇区中包含的任何数据都会丢失。由于传输中途断开连接或内存损坏,扇区可能会损坏。
memtest
通宵运行是明智之举。检查您尝试传输的文件是否有坏扇区的简单方法是使用
safecopy
。当文件无法完全复制时,它会通知您。有时,多次复制文件能够恢复坏扇区中包含的数据。发生这种情况时,您可能能够使用 等磁盘擦除实用程序进行“修复”srm
。可以使用 运行驱动器自检
smartctl
。还可以擦除和替换坏扇区,但如果这样做,将不知道丢失了哪些文件。有办法可以确定哪些扇区已损坏以及它们对应的文件。(稍后将更新信息。)
连接任一驱动器的接口(无论是否为 USB)都可能损坏。这会导致间歇性断开连接和传输不完整。
例如,我曾经遇到过一些 USB 3.0 驱动器在通过某些 USB 3.0 端口高速传输大文件时断开连接的情况。但是,当连接到 USB 2.0 端口时,它们工作正常。
连接驱动器的电缆可能已损坏或未完全插入。更换电缆。确保它们都已完全就位。