Personnellement je tape toujours sync trois fois, mais c'est plus par superstition que pour une réelle raison technique. J'ai trouvé dans une mailing list netbsd quelques raisons (historiques et techniques);
The original reason the old Unix hacks always recommended typing
"sync<CR>" three times before powering down the system was that doing so
on a sticky old teletype machine usually took long enough that the first
command had actually taken effect and by the time you could reach for
the power switch on the cabinet beside you the disks would have really
completed their writes.
Une justification éventuelle pour faire 2 sync au lieu d'un (je ne sais pas si c'est toujours le cas sous Linux) est que sync rend la main alors que les données ne sont pas forcément écrites : sync() returns once I/O for all delayed writes has
been scheduled, but not completed. That is, it converts
delayed writes into asynchronous writes, which usually
complete after it exits.
Enfin, mieux vaut faire trop de syncs que pas assez :)
[^] # Re: Bug ext3 dans le kernel 2.4.20
Posté par daggett . En réponse à la dépêche Bug ext3 dans le noyau Linux 2.4.20. Évalué à 3.
parmi la thread ( http://mail-index.netbsd.org/tech-kern/1999/01/(...) )
on trouve http://mail-index.netbsd.org/tech-kern/1999/01/15/0004.html(...)
The original reason the old Unix hacks always recommended typing
"sync<CR>" three times before powering down the system was that doing so
on a sticky old teletype machine usually took long enough that the first
command had actually taken effect and by the time you could reach for
the power switch on the cabinet beside you the disks would have really
completed their writes.
Une justification éventuelle pour faire 2 sync au lieu d'un (je ne sais pas si c'est toujours le cas sous Linux) est que sync rend la main alors que les données ne sont pas forcément écrites :
sync() returns once I/O for all delayed writes has
been scheduled, but not completed. That is, it converts
delayed writes into asynchronous writes, which usually
complete after it exits.
Enfin, mieux vaut faire trop de syncs que pas assez :)