3 ms·
I found a bit of folklore on that https://utcc.utoronto.ca/~cks/space/blog/unix/TheLegendOfSync https://utcc.utoronto.ca/~cks/space/blog/unix/TheLegendOfSyn...
by HankB99 4y ago
I found a bit of folklore on that https://utcc.utoronto.ca/~cks/space/blog/unix/TheLegendOfSync https://utcc.utoronto.ca/~cks/space/blog/unix/TheLegendOfSyn...
- smackeyacky 4y agoThat is awesome. I don't think it was ever explained properly back then, so you finding this is fantastic to me. Cheers!
- somesortofsystm 4y agoIts not quite accurate or good folklore though, because it misses the fact that "sync;sync;sync" is distinct from "sync <enter> sync <enter> sync <enter>" and the reason for that is that the machines (tape and otherwise) on the other end would interpret such fast contiguous syncs (as opposed to the human RNG) as instructions to, for example, rewind the tape .. or shuffle the card tray .. peripherals and resources which, alas, have fallen from our consciousnesses ..
- kjs3 4y agoIt was explained to me back in the stone age that one did 3 syncs because disks were slow enough that if you did one sync all the buffers might not be flushed before the reboot took hold. So do 3 syncs to make sure. Borking a filesystem wasn't fun. Not saying it's correct, and it's still a habit for me.
- somesortofsystm 4y ago"One sync tells the system to flush all i/o buffers, the second one serves to ensure the buffers are sync'ed, and the third is useful in case slow-quitting processes meanwhile even still have things to flush before letting go of a node, and then of course .. ;reboot .. " Yeah, but it also means, if done in rapid succession (i.e. one shell cmd "sync;sync;sync", it can tell the machine on the other end of the i/o to do 'special' operations, such as rewind tape, settle card tray intake, etc. Long-forgotten aspects of operation which neverless fit in the 'class' of action, where data is settled and made safe.