Is there a good file-copying tool?
The copy dialogue is stuck at 0 seconds left...
Whenever I try to copy big files to my USB pendrive (in any format), it always stops at the last moment. It finishes after a long time.
I searched Ask Ubuntu for similar Posts and got many, but none of them have good solutions.
So... Is there any alternative copying tool like Teracopy on Windows?
Or are there any fixes I can do?
Solution 1:
The reason that you see the copying happening the way you do is that writes to the USB drive are asynchronous.
When you copy a file it actually copies it in to the usb drive's buffer, which is in the RAM of your computer. The first part of the copy is very fast because it is just going in to the buffer. The data is flushed from the buffer to the USB drive at a much slower rate. Once the buffer has filled up it has to wait for some of the data to be flushed to disk before it can place any more in the buffer, so the copy then slows right down, effectively to the speed of the USB drive. Once all the file has been placed into the buffer it appears that the file has been copied. However not all the data has been flushed from the buffer onto the USB disk itself. Some copy programs just return and let that flushing carry on in the background. Some will wait until all the data has been flushed, which is why it will stay on 100% for some time.
You can switch the disk into synchronous mode which means that all data is immediately written to the USB drive without using the buffer. This will give the impression of a smoother transfer of data, but may actually end up with an overall reduction of speed.
If you manually mount the disk from the command line you can add -o sync
.
If you mount it using fstab you can add the sync
option.
If you rely on Ubuntu mounting it for you when you access it in the GUI you can modify the mount options from the command line once it is mounted:
sudo mount -o remount -o sync /media/yourname/diskname
Solution 2:
You should not worry about this too much.
Maybe your USB pendrive is of "lower quality".
The dialog output regarding the time is misleading.
Other copy tools may have a different output behavior,
but they do not improve the writing speed of the USB drive.
Most important of all is that finally the copy action succeeds.
What you can do is optimizing the input/output schedulers of disks.
Install gksu
(when you haven't already) to edit files with gedit
as root :
sudo apt-get install gksu
Now optimize the priority of all running processes for various disks types :
gksudo gedit /etc/udev/rules.d/60-schedulers.rules
Paste the following lines into this empty file and save the file afterwards :
# set cfq scheduler for rotating disks
ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}="cfq"
# set deadline scheduler for non-rotating disks
ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="deadline"
The changes you made take effect after a restart of the operating system.
Also ... an alternative copy solution is available in the Ubuntu repositories :
sudo apt-get install dirdiff
Now launch the tool from a terminal to compare or copy files and folders :
dirdiff
dirdiff
is a GUI for diff
and can handle up to 5 trees. It displays a main window with a list of files which are different between the trees, with colored squares to indicate the relative ages of the versions. A menu allows you to display the differences between any two of the versions in another window. Another menu allows you to copy files and folders from one tree to another.
Summary : Most relevant of all is the quality of the USB disk and its writing speed capabilities !