4

My Fedora 27 writes actual data to USB on umount. Before umount it works only with links or something like that. So, for example, when I transfer a big file of 5 GB cp /home/iam/bigFile /run/mnt/iam/myUSB/ it will be transferred in several seconds. But there are no actual writes. After I use umount /dev/sdd1 it will be unmounting the USB for several minutes.
If I remove the USB after cp /home/iam/bigFile /run/mnt/iam/myUSB/ but before umount /dev/sdd1 the file will be corrupted.
How to force Fedora to write real data when I use cp?

1
  • I haven’t tried, but I wonder if mounting it with the sync flag would help.
    – Jeff Schaller
    Nov 23, 2017 at 17:25

1 Answer 1

0

After copying the files, run sudo sync -f one/of/the/files. It will write all the filesystem cached data where that file is stored immediately. Read the man page for some regards on file systems.

3
  • Is it possible to configure sync by default? So, that all data I place to flash drives are written immediately?
    – Oleksandr
    Nov 23, 2017 at 17:17
  • You'd need to mount it with a write through option. I can't look into the details right now, but you should be able to find it with a simple internet search...
    – Zip
    Nov 23, 2017 at 17:36
  • Oh, @Jeff Schaller seems to have commented just that on your question...
    – Zip
    Nov 23, 2017 at 17:37

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.