Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Jun 2019 15:36:38 -0700
From:      "Simon J. Gerraty" <sjg@juniper.net>
To:        Alan Somers <asomers@freebsd.org>
Cc:        Scott Long <scottl@samsco.org>, Don Lewis <truckman@freebsd.org>, "Chuck Silvers" <chs@netflix.com>, Kirk McKusick <mckusick@mckusick.com>, "FreeBSD CURRENT" <freebsd-current@freebsd.org>, <sjg@juniper.net>
Subject:   Re: Reducing UFS corruption from unclean shutdowns?
Message-ID:  <18782.1561156598@kaos.jnpr.net>
In-Reply-To: <CAOtMX2heRbFONA4e7-buFgZeykCW13h1dC1DTVYOLFAier8wPg@mail.gmail.com>
References:  <CAOtMX2jPut4ve-Tr7DyikxXqnmqycyjEUpNmAiwUSXbQrK3iCA@mail.gmail.com> <C3016BDF-4B51-4A59-94F2-CCBD0DC4562E@samsco.org> <CAOtMX2jXiaOWpVdEg3_nBYinJWd=iwN_38hQ4eMOocgs8dMWhQ@mail.gmail.com> <F93827F6-1B99-4BDD-B245-C9594AD28ED7@samsco.org> <tkrat.bc0479d0867a8175@FreeBSD.org> <D7FC707D-B863-47F2-9580-C07881AAC866@samsco.org> <CAOtMX2heRbFONA4e7-buFgZeykCW13h1dC1DTVYOLFAier8wPg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Alan Somers <asomers@freebsd.org> wrote:
> I would've thought that immediately following a sync(8), the
> filesystem would be consistent.  Why do I still see errors after a

sync(8) does little more than tell the kernel to start flushing some
pages - which the kernel would do anyway in about 30s
So, it does not really ensure a clean filesystem if you are about to
reboot - and certainly not if a panic is imminent.

FWIW to minimize fs problems after doing package install on junos I run
fsync on files and dirs I know are likely to have been updated and which
need to be flushed to disk before reboot.

Unlike sync(8), fsync(1) will not return until the I/O is done.

You may still lose data after a sudden power cycle or panic, but less
likely to be something critical.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?18782.1561156598>