I have recently had some problems when copying large data (usually > 2 GB) from main hard disk to another, mounted at /media. I tried to read some threads around but I could not find an answer. Both filesystems are formatted in EXT4 and I do not think my disk has problems because I recently changed it trying to find a solution. In particular the copying process stops, the filesystem is auto-remounted as read-only and I get a "Error splicing file: input/output" message.
My computer is running Ubuntu 16.04.4; I attach dmesg -H output for major info. Ask me for every piece of information you need. Thank you in advance for all.
[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 output:
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
Corrupt file systems are associated with problems transferring files. This could be either a cause or a symptom. Regardless, the filesystems should be unmounted and fixed with
fsck -f
. To check filesystems that cannot be unmounted, usesudo touch /forcefsck
and reboot.The source drive could be failing or have corrupted sectors. Large files are more likely to have problems because they cross a greater number of sectors. Any data contained within bad sectors are lost unless you have backups. Sectors can become corrupt as a result of disconnecting mid-transfer or corrupt memory. It would be prudent to run
memtest
overnight.A simple way to check whether the file you are trying to transfer has bad sectors is to use
safecopy
. It will notify you when files cannot be copied fully. Sometimes, multiple passes over a file is able to recover data contained on bad sectors. When this happens, you may be able to "fix" with a disk wiping utility likesrm
.Drive self tests can be run with
smartctl
. Bad sectors can also be wiped and replaced, but if done this way, it will be unknown which files are lost.There are ways to figure out which sectors are corrupt and which files they correspond to. (Will update later with info.)
The interface, whether USB or not, through which either of the drives is connected could be damaged. This would cause intermittent disconnections and incomplete transfers.
For example, I have had some USB 3.0 drives disconnect when transferring large files at high speed through some USB 3.0 ports. However, when connected to USB 2.0 ports, they work fine.
The cables connecting the drives could be damaged or not fully plugged in. Change cables. Make sure they are all fully seated.