[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: sleep(1) vs. sync(1) twice before umount(8)



Le 10/07/2022 à 19:46, fxkl47BF@protonmail.com a écrit :
On Sun, 10 Jul 2022, David Christensen wrote:

On 7/10/22 09:57, fxkl47BF@protonmail.com wrote:
On Sun, 10 Jul 2022, David Christensen wrote:
On 7/10/22 05:55, fxkl47BF@protonmail.com wrote:
Several decades ago I was taught to type sync and then type sync
again before unmounting a drive
The only reason I ever got was that the second sync was a time delay
Any potential gotchas?
I was never brave enough to poke that bear :)

Have you ever experienced any problems or surprises with the technique?
No
I spent a couple of decades baby sitting a room full of HP K200s and K380s
Experimenting was not something done lightly, if you valued your job
You stick with what works
Typing sync twice was advised and I was not inclined to anger some unknown god
Using sleep between operations is as you say experimental
I wrote many scripts that ran as cron jobs at night
I was not concerned with speed
I've been retired for almost a decade and do not miss the sleepless nights


IIRC the second sync() was blocked until the first one finished. Thus you were sure to wait the completion of the sync() whereas the sleep()  waits for a fixed amount of time. However, I'm not sure it is still needed with modern file systems


Reply to: