Remember "sync; sync; sync; halt"?

An article all about rebooting Unix:

My recollection of the “sync; sync; sync” story as I heard it is that the first one flushes buffers but may cause filesystem updates which the second one clears up. But the article tells a different story (and makes some sense too.)

2 Likes

I first remember learning that you ran sync twice at the command line, not with semicolons (as the author mentions) and then powered down the machine. I don’t know where I learned it, but almost certainly from a computing book I got at the local library. The explanation given there was exactly the same as this article, that it gave the disks time to actually sync before the machine was powered down. There was no mention of a halt command. The instructions were also very clear that this must be done on an idle machine, and that you needed to kick all of the interactive users off their TTYs before shutting down.

This is the practice I follow on my v6 Unix install for PDP-11, and so far I haven’t corrupted a disk. I do understand that it’s only a matter of time, though!

4 Likes

Up until maybe 5 to 10 years ago, if I was sitting at a console thinking about an issue my hands would still randomly type in "sync " exactly because of this. Some habits die really hard.

1 Like