Re: Reducing UFS corruption from unclean shutdowns?

From: Simon J. Gerraty <sjg_at_juniper.net>
Date: Fri, 21 Jun 2019 15:36:38 -0700
Alan Somers <asomers_at_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.
Received on Fri Jun 21 2019 - 20:37:01 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:21 UTC