Posted: . At: 9:32 AM. This was 4 years ago. Post ID: 14083
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.


Ubuntu not always writing data to USB hard drives when I copy files to them.


Sometimes I copy files from my Linux installation to my NTFS external hard drive, and the files are not always fully transferred. This must be due to the fact it is always connected and therefore I am not removing it. But if I run the sync command in a terminal, it fixes that problem and tells Ubuntu to copy cached writes to the hard drive. Typing the sync command and a list of files will force the writes to the drive.

sync myfile1 myfile2 myfile3

So, if you are having problems with files as I am, this should help fix the problem. It is good that Linux has many useful commands to solve problems like this. It is very useful when an issue is found, and then you may find an easy to use utility to fix the issue. Disabling cached writes is possible, but may not be a good idea. The sync command does the job very well and is the perfect solution to a small issue. Properly unmounting a drive before removing it or rebooting will also help, this will ensure that cached writes are written to the drive. You cannot just unplug a USB drive in Linux and expect the data to be properly written to it.

People do this in Windows, but it is a bad idea.


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.