From owner-freebsd-questions Mon Oct 1 17:57:22 2001 Delivered-To: freebsd-questions@freebsd.org Received: from guru.mired.org (okc-65-31-203-60.mmcable.com [65.31.203.60]) by hub.freebsd.org (Postfix) with SMTP id 3D78C37B40B for ; Mon, 1 Oct 2001 17:57:19 -0700 (PDT) Received: (qmail 1878 invoked by uid 100); 2 Oct 2001 00:57:18 -0000 From: Mike Meyer MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15289.4333.907347.872523@guru.mired.org> Date: Mon, 1 Oct 2001 19:57:17 -0500 To: Carl Schmidt Cc: questions@freebsd.org Subject: Re: accidently pulled the plug... In-Reply-To: <93236649@toto.iv> X-Mailer: VM 6.90 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`;h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Carl Schmidt types: > On Mon, Oct 01, 2001 at 09:26:29PM +1000, Edwin Groothuis wrote: > > If you have softupdates enabled on your filesystems, then you will probab= > ly > > have the least problems. > Just a quick point regarding softupdates...softupdates is not the cure for > cancer many people like to make it out to be. It protects metadata and that= > is > all it protects. You are much more likely to lose data (NOTE: not metadata - > data) using softupdates if you are doing something disk intensive at the ti= > me > of the plug pulling or whatever other event causes a not-normal shutdown. Right. I was going to say something about that myself. There are actually *four* modes that you can mount file systems in. softupdates is the third safest. Safest first, it's: 1) sync. All data is written to disk synchronously. 2a) softupdates: Metadata is written synchronously, but ordered to increase performance and insure the integrity of the metadata. Data is still written asynchronously. 2b) noasync. Metadata is written synchronously, data asynchronously. This is the default mode. 3) async. Data and metadata are both written asynchronously. This is the default (and maybe only mode) for Linux. sync, noasync and async are flags at mount time. softupdates is a property of the file system. If softupdates is enabled, those flags are ignored. softupdates and noasync are both 2 because ordering the metadata writes takes a bit of time, increasing the danger of losing metadata. In doing so it makes sure the metadata on disk is in a consistent state, which means your disk is actually less likely to be damaged. Given those tradeoffs, some people consider softupdates more dangerous than noasync. I put it at 2a because it's nearly as fast as async. As a final note, if you are running a disk with write caching but not tagged queuing, the *drive* is running in async mode. It may be less safe, because Unix uses an algorithm that prevents a buffer kept indefinitely, but some drives don't. On the other hand, some drives make sure they have enough spare power around to guarantee the cache will be flushed if they lose power, so it's no problem. I have no idea how to tell which is which. http://www.mired.org/home/mwm/ Q: How do you make the gods laugh? A: Tell them your plans. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message