File transfer stuck at 100%
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
File transfer stuck at 100%
When I copy large files to USB it get stuck at 100% and never finishes. No issue with smaller files. Why and what to do to fix it?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: File transfer stuck at 100%
'...why...' The OS can and by default does buffer the file being transferred into RAM, then sends it to the destination drive. If you run the command...
...you will see a kernel parameter...
vm.dirty_ratio = 20
...which means each destination drive is allowed to use 20% of the RAM as a write-buffer.
'...never finishes...' If you have a 4GiB RAM and a USB stick that writes at 10MiB/s that's around 82 seconds of writing RAM to the drive after the OS says '100% complete'. It's reporting progress writing to the RAM buffer, not progress writing to the drive.
'...what to do to fix it...' The following command cures this annoyance, replacing the 20% with an exact maximum, 8 mega bytes, just 1 second of data in transit.
sysctl -a
...you will see a kernel parameter...
vm.dirty_ratio = 20
...which means each destination drive is allowed to use 20% of the RAM as a write-buffer.
'...never finishes...' If you have a 4GiB RAM and a USB stick that writes at 10MiB/s that's around 82 seconds of writing RAM to the drive after the OS says '100% complete'. It's reporting progress writing to the RAM buffer, not progress writing to the drive.
'...what to do to fix it...' The following command cures this annoyance, replacing the 20% with an exact maximum, 8 mega bytes, just 1 second of data in transit.
sudo sysctl vm.dirty_bytes=8000000
### Limit buffered drive writes to a sane maximum.