I had some problem. I need to copy about 10 million small files to an external hard drive. I was trying to do the job by several ways, but nothing worked.
First I tried cp command. But after about a million of files were copied, it slowed down badly.
Second I tried to make a tar. But after about 20 hours of work only 5 million files were archived.
Then I tried the rsync command. But the result was the same as with the copy command.
At the end my external drive stopped working at all...
I have a new external hard drive. The problem begin when I was trying to copy fileswith the help of rsync command
After an hour about 1 million files were copied, but then the process stopped I canceled the process and now I cannot open my hard drive The process was canceled by CTRL + C in the terminal. After that I couldn't open the dist and just restarted the PC
If I try to open it, it gives an Error:
Unable to access Transcend. An operation is already pending
If I open the Disks. I can see the Hard Drive there.
Assessment: Disk is Ok
But there is an active Job.
Mounting Filesystem.
Menu for the disc is unavaliable. I cannot format it.
I've already restarted the PC. No changes I've also tried to remove the hard drive and insert it again. But also no changes
How can I fix this problem?
I'm using Ubuntu 20.04. External Hard Drive format is ext4
Finally I have 2 problems.
- I still don't know how to copy such amount of files.
- My external hard drive stopped working (
Update lsblk:
sde 8:64 0 3,7T 0 disk
└─sde1 8:65 0 3,7T 0 part
rsync
process, if you flushed buffers to the drives & cleanly unmounted the file-system. – guiverc Jun 01 '22 at 11:20fsck
or file-system checks before normal operation. – guiverc Jun 01 '22 at 11:36lsblk
output after inserting your disk. – FedKad Jun 01 '22 at 11:43df -i
to see inodes Do you really need all these as files? Sounds like the data should be in a database. – oldfred Jun 01 '22 at 12:44Where should I run this command? – djangodjames Jun 01 '22 at 14:42
sudo lshw -C disk
and look for your external drive model on the list. If it is not there you might have either a bad USB port, bad USB cable or the USB drive drive or its casing went bad. Try it on another computer to see if it can see your drive. – Terrance Jun 01 '22 at 15:40sync
after copying files to USB drives. If the inodes are the problem you should usetar
to create one container with all files in it. Doesgparted
work on that disk? – AlexOnLinux Jun 27 '22 at 07:41