6

I found out some problems copying larger amount of files from USB hard drive. For example copying my Documents, which is 13.035 files, in total size of 21,2GB. It started to copy, but after a while the whole system had frozen. When frozen, I was not able to move with mouse, or do anything. Even CTRL+ALT+PRT SC+REISUB for software reset hasn't worked, so I had to perform hard reset with power button. I had to repeat about 3 or 4 times, to be able to copy the whole Document folder. I dont't remember, this would happen on Ubuntu 22.04. I have tryied 2 different PC's and 2 different USB hard drives and different folders (Documets, Photos, Thunderbird or Firefox profile files). This happened at least 1 time with every combination.

PC'S i have tryied:

  • Lenovo Ideapad 320-15ABR with 960GB SSD disc, 20GB RAM, 9GB Swap File
  • HP notebook with 1TB SSD disc, 8GB RAM, 15GB Swap file

USB hard drives I have tryied:

  • 1TB Verbatim USB disc
  • 1TB WD Element USB disc

I have found similar questions on the forum:

2 Answers2

1

You will not find a fix for a crash on AskUbuntu. Nor will there be a quick fix.

The main cause will be the way that Linux handles NTFS formatted disks. Linux uses a kernel module called ntfs-3g to read and write to NTFS formatted disks. This module is not a 100% alternative for the native NTFS driver used by Windows. Especially searching the limits of the driver is likely to cause unwanted behaviour.

If you want a fix for a crash you need to file a bugreport at the gitgub page for ntfs-3g. But they likely want lots of logs and not a "It crashed".

But there are a couple of things you can do to avoid a crash or to mitigate the problems caused by a problem copying files:

  • command line rsync is the tool to use. With rsync you can limit bandwith usage, it will use compression when poossible, and it allows for resume. And the desktop will use resources better used for the copy process.

  • Command line you can also use options to show detailed information using the -v option. Lots of tools support -vvvvv and will show info about connection, configuration problems. That might report what it is that is the problem so it can be investigated.

  • NTFS uses journaling. To disable journaling, you can use ntfs-3g with the -o discard option and that will improve performance.

Rinzwind
  • 309,379
0

I have same thing. While copying a dir with lots of sub-dirs and files (over 200k) from usb disk to internal ssd disk, or hdd disk. It's just freezes the whole computer. So i said: WTF! So now i'm copying subdirs from the main dir one by one. So far so good... Then it hung again at 99,957 files. Thinking there could a max of 100k? It was the largest subdir, with also each many subdirs. So i started to copy these also one by one. Then noticed it hun at a specific subdir with other subdirs. So i went down the rabbit hole... The destination seems to have corrupt files from the source. I deleted them. The source was ok, so i copied them again. No problems so far. Then i ran the: rsync -av SOURCE DESTINATION command. To let it check for missing / differences in files. Then i compared the disk usage, by summing all sizes of all files on both disks: ls -Rl Amsterdam | grep -v '^d' | awk '{size+=$5; printf "%d\r",size} END {print size }' Still got a difference. Seemed i've had a new .sh file in the Dest dir. With the rsync -av --delete SOURCE DESTINATION i made them exactly the same. Yes, an exact match. So a solution could be using the rsync command. It seems to check file for file, dir to dir, not all the files in dirs e/o subdirs.