Re: Shutdown - 25 Years Later

Liste des GroupesRevenir à col misc 
Sujet : Re: Shutdown - 25 Years Later
De : invalid (at) *nospam* invalid.invalid (Richard Kettlewell)
Groupes : comp.os.linux.misc
Date : 20. Apr 2025, 08:13:53
Autres entêtes
Organisation : terraraq NNTP server
Message-ID : <wwv5xizpaoe.fsf@LkoBDZeT.terraraq.uk>
References : 1 2 3 4 5 6
User-Agent : Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Jim Jackson <jj@franjam.org.uk> writes:
On 2025-04-19, Charlie Gibbs <cgibbs@kltpzyxm.invalid> wrote:
The story I heard was that typing "sync" three times takes long
enough that the system has time to flush all its buffers before
you do anything else.
>
But sync shouldn't return until the buffers have flushed.
So repeats are not needed.

sync is allowed to return before the flush has completed. See
https://pubs.opengroup.org/onlinepubs/9699919799/functions/sync.html.


On Linux (or any other sensible platform), with the normal user tools,
no explicit syncs are needed at all. The normal shutdown process takes
care of the whole question. The behavior of sync is irrelevant and any
theory about needing typing sync even once is a myth.

On other platforms, the same is usually true.


The exceptions to this are:

(a) An operating system that doesn’t guarantee clean shutdown in the
    same way. (Personally I’d consider that a bug.)
(b) Directly issuing a reboot syscall (i.e. bypassing user commands like
    halt or systemctl), or interrupting power.

Explicit syncs don’t help as much as you might hope here, for a couple
of reasons:

1) As noted above, sync isn’t guaranteed to block until all data is
   flushed anyway; it’s allowed to return immediately, with any pending
   writes going on in the background. It happens that on Linux, sync
   _does_ block, so that’s not an issue for us, but on many platforms[1]
   it is not guaranteed to block.

2) Further writes may be initiated after the final call to sync (if
   nothing else, to update st_atime on /sbin/halt and its dependencies);
   no matter how many times you run it, even if you wait until the final
   sync completes, you still do not have a 100% guarantee about data
   persistence.

In short there’s no number of syncs that will guarantee your data is all
actually on disk.

[1] Including FreeBSD, Darwin, HP-UX, OSF/1, Ultrix, SunOS, Solaris, V7
    and at this point I stop looking.

--
https://www.greenend.org.uk/rjk/

Date Sujet#  Auteur
18 Apr 25 * Re: Shutdown - 25 Years Later49Eli the Bearded
18 Apr 25 +* Re: Shutdown - 25 Years Later3Lawrence D'Oliveiro
18 Apr 25 i`* Re: Shutdown - 25 Years Later2Eli the Bearded
18 Apr 25 i `- Re: Shutdown - 25 Years Later1Lawrence D'Oliveiro
18 Apr 25 `* Re: Shutdown - 25 Years Later45Andy Burns
18 Apr 25  +* Re: Shutdown - 25 Years Later42Lawrence D'Oliveiro
19 Apr 25  i`* Re: Shutdown - 25 Years Later41Jim Jackson
19 Apr 25  i +- Re: Shutdown - 25 Years Later1Lawrence D'Oliveiro
20 Apr 25  i `* Re: Shutdown - 25 Years Later39Richard Kettlewell
20 Apr 25  i  +- Re: Shutdown - 25 Years Later1The Natural Philosopher
20 Apr 25  i  `* Re: Shutdown - 25 Years Later37Pancho
20 Apr 25  i   +- Re: Shutdown - 25 Years Later1Richard Kettlewell
20 Apr 25  i   `* Re: Shutdown - 25 Years Later35Computer Nerd Kev
20 Apr 25  i    +- Re: Shutdown - 25 Years Later1Computer Nerd Kev
21 Apr 25  i    `* Re: Shutdown - 25 Years Later33Lawrence D'Oliveiro
22 Apr 25  i     `* Re: Shutdown - 25 Years Later32Carlos E.R.
22 Apr 25  i      +* Re: Shutdown - 25 Years Later22The Natural Philosopher
22 Apr 25  i      i+* Re: Shutdown - 25 Years Later17Carlos E.R.
22 Apr 25  i      ii+- Re: Shutdown - 25 Years Later1Pancho
22 Apr 25  i      ii`* Re: Shutdown - 25 Years Later15The Natural Philosopher
22 Apr 25  i      ii +* Re: Shutdown - 25 Years Later4Pancho
22 Apr 25  i      ii i+* Re: Shutdown - 25 Years Later2The Natural Philosopher
23 Apr 25  i      ii ii`- Re: Shutdown - 25 Years Later1Pancho
22 Apr 25  i      ii i`- Re: Shutdown - 25 Years Later1Lawrence D'Oliveiro
23 Apr 25  i      ii `* Re: Shutdown - 25 Years Later10candycanearter07
24 Apr 25  i      ii  `* Re: Shutdown - 25 Years Later9Lawrence D'Oliveiro
25 Apr 25  i      ii   `* Re: Shutdown - 25 Years Later8candycanearter07
26 Apr 25  i      ii    `* Re: Shutdown - 25 Years Later7Lawrence D'Oliveiro
28 Apr 25  i      ii     `* Re: Shutdown - 25 Years Later6John Ames
28 Apr 25  i      ii      +* Re: Shutdown - 25 Years Later4Richard Kettlewell
29 Apr 25  i      ii      i`* Re: Shutdown - 25 Years Later3The Natural Philosopher
29 Apr 25  i      ii      i `* Re: Shutdown - 25 Years Later2Richard Kettlewell
29 Apr 25  i      ii      i  `- Re: Shutdown - 25 Years Later1The Natural Philosopher
29 Apr 25  i      ii      `- Re: Shutdown - 25 Years Later1Lawrence D'Oliveiro
22 Apr 25  i      i+* Re: Shutdown - 25 Years Later3Richard Kettlewell
22 Apr 25  i      ii+- Re: Shutdown - 25 Years Later1Lawrence D'Oliveiro
23 Apr 25  i      ii`- Re: Shutdown - 25 Years Later1The Natural Philosopher
22 Apr 25  i      i`- Re: Shutdown - 25 Years Later1Lawrence D'Oliveiro
22 Apr 25  i      `* Re: Shutdown - 25 Years Later9Lawrence D'Oliveiro
23 Apr 25  i       `* Re: Shutdown - 25 Years Later8Carlos E.R.
24 Apr 25  i        `* Re: Shutdown - 25 Years Later7Lawrence D'Oliveiro
25 Apr 25  i         `* Re: Shutdown - 25 Years Later6Carlos E.R.
26 Apr 25  i          +- Re: Shutdown - 25 Years Later1Lawrence D'Oliveiro
26 Apr 25  i          `* Re: Shutdown - 25 Years Later4The Natural Philosopher
26 Apr 25  i           +* Re: Shutdown - 25 Years Later2Richard Kettlewell
26 Apr 25  i           i`- Re: Shutdown - 25 Years Later1Lawrence D'Oliveiro
26 Apr 25  i           `- Re: Shutdown - 25 Years Later1Lawrence D'Oliveiro
18 Apr 25  `* Re: Shutdown - 25 Years Later2The Natural Philosopher
19 Apr 25   `- Re: Shutdown - 25 Years Later1Lawrence D'Oliveiro

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal