Date: Mon, 09 Feb 2015 16:29:11 -0500 From: Kurt Lidl <lidl@pix.net> To: freebsd-stable@freebsd.org Subject: Re: freebsd-update and hang during reboot Message-ID: <54D926A7.8060806@pix.net> In-Reply-To: <1423501720.16794.18.camel@freebsd.org> References: <1423501720.16794.18.camel@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Ian Lepore wrote: >> I ran into this problem in spades when upgrading a set of servers from >> FreeBSD 9.0 to 9.1. I happened consistently. Normal reboots worked, >> but when going from 9.0 to 9.1, it *ALWAYS* hung, and it always hung >> at the same place, after printing the "All buffers synced" message. >> >> I ultimately determined that if I did the following, rather than >> just a "reboot" or "shutdown -r now 'FreeBSD 9.1-RELEASE upgrade'", >> it would consistently AVOID the hang: >> >> sync ; sync ; sync ; shutdown -o -n -r now "FreeBSD 9.1 install" >> >> Your mileage may vary, but you don't have a lot to lose by trying it. >> >> -Kurt >> > > That is just bad advice. sync(1) does not g'tee that all data has been > written, no matter how many times you type it. shutdown -n tells the > system to abandon unwritten data. All in all, this is a recipe for > silent filesystem corruption. Using it after an update is just asking > to have a mix of old and new files on the system after the reboot. I didn't specify that I was using ZFS, but I was. And this comment in the ZFS code (zfs_vfsops.c, line 170): /* * Sync all ZFS filesystems. This is what happens when you * run sync(1M). Unlike other filesystems, ZFS honors the * request by waiting for all pools to commit all dirty data. */ spa_sync_allpools(); Says that sync() won't return until the dirty data is flushed. For my use case, I believe it was perfectly safe. -Kurt
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?54D926A7.8060806>