I have a Raspberry PI 4 (4GB) with raspbian OS lite installed.
I am trying to copy data from one hard disk to another and every time the transfer fails after copying few files and the drives are unmounted.
Strangely or not, 10 out of 10 times I can transfer data between same two hard disks on different laptop running Ubuntu. The data is around 65GB.
The drives are never auto mounted so below is the fstab I am using to mount the drives. UID=GID=1002 is a user having same rights as user pi.
When I copy, I am logged in with the 1002 user.
LABEL=backup /mnt/backup ntfs-3g uid=1002,gid=1002,umask=077,fmask=077,defaults,auto,nofail,noatime 0 2 LABEL=Personal /mnt/source/personal ext4 defaults,auto,nofail,noatime 0 2 LABEL=Media /mnt/source/media ntfs-3g uid=1002,gid=1002,umask=077,fmask=077,defaults,auto,nofail,noatime 0 2 LABEL=Work /mnt/source/work ext4 defaults,auto,nofail,noatime 0 2
Below are the errors I get:
When using cp -rv /mnt/source/media/ /mnt/backup/
cp: cannot stat '/mnt/source/media/Books': No such file or directory
When using rsync -htrvP /mnt/source/media/ /mnt/backup/
sending incremental file list ./ rsync: failed to set times on "/mnt/backup/AWS-Dev": Input/output error (5) default_perms_for_dir: sys_acl_get_file(AWS-Dev, ACL_TYPE_DEFAULT): Input/output error, falling back on umask rsync: recv_generator: failed to stat "/mnt/backup/AWS-Dev/0.mp4": Input/output error (5)
When using rsync -htrvP --omit-dir-times /mnt/source/media/ /mnt/backup/
sending incremental file list rsync: recv_generator: mkdir "/mnt/backup/AWS-Dev" failed: Input/output error (5) *** Skipping any contents from this failed directory ***
Most of the times only backup drive gets unmounted and below is how it looks after ls command
This is how it usually looks:
Also, strangely when drives are plugged in the Pi, they make a lot of clicking noise while there's almost no noise when these drives are connected to the other laptop.
I am trying various solutions from various forums but no success. I tried various forums for answers where the suggestions were mostly like the drive is dying, I ran a disk check, got only 8 bad sectors on the backup drive. I reformatted to ext4 then to ntfs with no change in results. Tried both drive plugged to USB3 ports and then both to normal USB port. Only once with both on normal USB ports the rsync went a lot longer than other times but failed eventually.
As said previously, on other laptop the transfer is always successful and on pi never.
I am not a linux poweruser and completely clueless now.
Note: The pi is new and both hard drive enclosures are new and are USB3.