Re:PostgreSQL used fsync incorrectly for 20 years
by pmontra on Sunday February 10, 2019 @04:09AM
(#19127004)
I also noticed that on Gnome. I never investigated the implementation details of that progress bar but my gut feelings is that the file is read from (or written to) the buffer cache quickly and the progress bar goes near to 100%, then stays there until the last writes succeed and actually write to the USB stick. Then the eject button sometimes need extra time to finish the sync and tells me to wait a little. I always remove the stick when it tells me it's safe to do it.
Re:PostgreSQL used fsync incorrectly for 20 years
by loeg on Sunday February 10, 2019 @12:35PM
(#19128824)
Your intuition is correct. The writes are quickly buffered to RAM and then fsync or close writes them out to the slo media. The (naive) progress bar probably only tracks progress buffering the writes — it's the simplest way to track progress, if inaccurate.
Re:PostgreSQL used fsync incorrectly for 20 years
by spatular on Sunday February 10, 2019 @09:22PM
(#19131593)
Yes. You can also run "watch cat /proc/meminfo" in console and watch "Dirty" and "Writeback" fields to see dynamics (and how long you have to wait).
Re:PostgreSQL used fsync incorrectly for 20 years
by snthd on Sunday February 10, 2019 @09:16AM
(#19127834)
That behaviour is defined by a mount option.
Re:PostgreSQL used fsync incorrectly for 20 years
by Jerry2 on Sunday February 10, 2019 @06:17PM
(#19130767)
What's the proper way to mount flash devices?
Re:PostgreSQL used fsync incorrectly for 20 years
by ciupicri on Sunday February 10, 2019 @08:27PM
(#19131404)
Try the sync option. From the man page:
> All I/O to the filesystem should be done synchronously. In the case of media with a limited number of write cycles (e.g. some flash drives), sync may cause life-cycle shortening.
Needless to say, this tripped me up few times and videos weren't fully transferred.