I have been facing this issue ever since I started using Linux distributions. While copying/moving either graphically or with cp
, one/many big content (anything like a big text file, tar.gz archive, ISO image file, and movies), some part of the content is written to disk and some part cached in memory (RAM). During the copying time, the amount of shared and cached memory dramatically increased (checked with free -m
).
After some time the file manager (like Dolphin or PCManFM) or cp
shows that copying is finished, but data is actually not written to disk until I do a sync
I think this is not a hardware issue.
I checked with many internal and external hard drives, and USB flash drives of various brands, but all with the same result.
Not a 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 distribution-specific issue. I checked with Debian, Fedora, Ubuntu, Slax, etc.
I have not crosschecked with other Unix-like OSes. If anyone have/had the same issue with FreeBSD, OpenBSD, etc. please let me know.
What is the problem and how can I solve it?
mount
options. You shouldumount
a media (e.g. your USB key) before unplugging it (that would flush the data to the disk). You could continue usingsync
– Basile Starynkevitch Jun 20 '15 at 05:47sync
. Thank you for your comment , will you consider to write it as an answer ? – Arnab Jun 20 '15 at 09:09