I'm facing this issue since ever I started using Linux Distros. While copying/moving either graphically or with cp one/many big content(anything like big text file, tar.gz archive, iso file, movies) some part of the content is written to disk , some part cached in memory(RAM). During the copying time, amount of shared and cached memory dramatically increased(checked with free -m).

After some time file manager(like Dolphin,PCManFM) or cp shows that copying is finished but data actually not written to disk until I do a sync

I think this is not a hardware issue.

  • Checked with many internal and external hard drives, USB flash drives of various brands but all with the same result.

    • No hard drive APM issue , I always disable hard drive power management.

    • The problem is same with dd and cat , like dd if=live.iso of=/dev/sdb .

    • Not a distro specific issue, Cheked with Debian, Fedora, Ubuntu, Slax etc.

    • Not crosschecked with other UNIX like OSs, if anyone have/had the same issue with FreeBSD,OpenBSD etc. please let me know.

So what is the Problem and how to solve it ?

  • It is not a problem, but a feature. linuxatemyram.com – Basile Starynkevitch Jun 20 '15 at 5:32
  • okay , got it , but I want that data to be written on the disk, like making a live USB, taking a movie from a friend etc and I want it as fast as possible. Is there any workaround to avoid/disable it ? – Arnab Jun 20 '15 at 5:38
  • You might use some mount options. You should umount a media (e.g. your USB key) before unplugging it (that would flush the data to the disk). You could continue using sync – Basile Starynkevitch Jun 20 '15 at 5:47
  • Everything explained very well at linuxatemyram.com/play.html , I will stick with sync . Thank you for your comment , will you consider to write it as an answer ? – Arnab Jun 20 '15 at 9:09

As I commented (and for obvious performance reasons) the kernel is using a page cache. So this is a feature, not a problem. See http://linuxatemyram.com/ for more.

You could (but I don't recommend doing that) using some mount options (to disable, or lower the use of, the page cache), and you need to umount any device (e.g. an USB key) before unpluggging or removing it. Then the kernel would flush all the data before unmounting.

You can also do a sync.


It is by design that the kernel tells userspace utilities that a file operation completed successfully while the caches are buffered.

Try editing /etc/hdparm.conf to disable write caching with the option write_cache = off. However this will reduce performance, and it is usually preferred to use sync if you want to ensure write buffers are flushed to disk.

  • /etc/hdparm.conf says write_cache = off for IDE drives , though disabled write-cache temporarily with hdparm -W 0 /dev/sda but this is even worst, laggy performance. Anyway I will stick with sync. but what is wrong wiyh USB flash drives , they dont support write-caching ? – Arnab Jun 20 '15 at 5:57
  • 3
    write_cache = off in /etc/hdparm.conf only disables the write cache in the drive, it doesn't affect the kernel's caches. – Stephen Kitt Jun 20 '15 at 8:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.