When copying a large file on Linux transfer hangs at the end… And you want to f**king kill someone.

There’s an annoying bug in almost every Linux distribution I’ve worked with. When your copying a large file to usb device (pendrive etc.) it hangs at the end (I mean it haaaaaaaaaaaaangs).

I’ve found a solution that works on Elementary and Ubuntu (at least).

Simply paste this two commands in your terminal:

sudo sh -c 'echo $((48*1024*1024)) > /proc/sys/vm/dirty_bytes'
sudo sh -c 'echo $((16*1024*1024)) > /proc/sys/vm/dirty_background_bytes'

Add this to some kind of startup script and forget about transfer problems…

Published by

Konrad Fedorczyk

Konrad Fedorczyk

I'm interested in programming and gamedev. I especially luv HTML5 and everything connected to web technologies.

2 thoughts on “When copying a large file on Linux transfer hangs at the end… And you want to f**king kill someone.”

  1. Thanks for the correct command. I did find this on other forums but did not now the exact command for elementary.

    How to add this to a startup script?

    1. Create a file for your startup script and write your script in the file:

      $ sudo nano /etc/init.d/superscript
      Save and exit: Ctrl+X, Y, Enter

      Make the script executable:

      $ sudo chmod 755 /etc/init.d/superscript
      Register script to be run at startup:

      $ sudo update-rc.d superscript defaults

Leave a Reply

Your email address will not be published. Required fields are marked *