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?
Asked
Active
Viewed 850 times
4
Jeff Schaller
- 66,199
- 35
- 114
- 250
Oleksandr
- 999
- 4
- 13
- 22
-
I haven’t tried, but I wonder if mounting it with the sync flag would help. – Jeff Schaller Nov 23 '17 at 17:25
1 Answers
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.
Zip
- 962
- 6
- 16
-
Is it possible to configure sync by default? So, that all data I place to flash drives are written immediately? – Oleksandr Nov 23 '17 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 '17 at 17:36
-