From owner-freebsd-stable@FreeBSD.ORG Fri Apr 1 18:09:34 2011 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C6FA106566C for ; Fri, 1 Apr 2011 18:09:34 +0000 (UTC) (envelope-from cptsalek@gmail.com) Received: from mail-ew0-f54.google.com (mail-ew0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 9D30E8FC16 for ; Fri, 1 Apr 2011 18:09:33 +0000 (UTC) Received: by ewy1 with SMTP id 1so1213628ewy.13 for ; Fri, 01 Apr 2011 11:09:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=dx8/zhAQCXvoYuZC7FkPQc945ap2hUQLIMvgID4YQCE=; b=xrVYEYr+Ay5RFLfEa7BY+T4EsDCLyVKdGzVvZAAA5w3WCJLr8utAqyVSdBb5PxDaMq ZKD4Ej4yvRqGckJ6hQMQDdExTCHKU90y2MklI5T0CKnAh1tP2lS9c7BsJYrGMd1rmOOD inzLYwYkzuX792D4JvaxzCt6QtmhHgFHEHk+U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=X9ZnpcJxOULqBZw/hvZnwR/yn2ByTExW7SpCV6xMGoeZX8BTVCi8gfJl4MSt9gPCBp idbas63wmMxL6mvFjI1dPiSu1fDBicP7H71PRGJIbGYxpXQL1+o4przTwP2qqCpcxXDQ WHdx9uU0oXWMLVMO08kl+UOpFdg9gDknWI7u4= MIME-Version: 1.0 Received: by 10.213.22.148 with SMTP id n20mr584194ebb.40.1301681371973; Fri, 01 Apr 2011 11:09:31 -0700 (PDT) Received: by 10.213.4.140 with HTTP; Fri, 1 Apr 2011 11:09:31 -0700 (PDT) In-Reply-To: References: <87d3l6p5xv.fsf@cosmos.claresco.hr> <874o6ip0ak.fsf@cosmos.claresco.hr> <7b15d37d28f8ddac9eb81e4390231c96.HRCIM@webmail.1command.com> Date: Fri, 1 Apr 2011 20:09:31 +0200 Message-ID: From: Christian Walther To: Adam Vande More Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: mlerota@claresco.hr, freebsd-stable@freebsd.org, Chris H Subject: Re: Constant rebooting after power loss X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Apr 2011 18:09:34 -0000 On 1 April 2011 19:38, Adam Vande More wrote: > On Fri, Apr 1, 2011 at 12:02 PM, Chris H wrote: > >> On Fri, April 1, 2011 6:29 am, Marko Lerota wrote: >> > =A0I read that ZFS don't need fsck because the files are always consis= tent >> on >> filesystem regardless >> > of power loses. That the corruption can occur only if disks are damage= d. >> But not >> > when power goes down. >> >> Complete nonsense. The information you read was false. >> > > =A0No, it's really not. =A0ZFS's lack of recovery tools at least in the > beginning were basically non existent. =A0 This is because ZFS uses a COW > model with an atomic data management unit design which by it's nature > addresses thing like fsck, and sudden power loss. Indeed. By copy on write and its' b-tree ZFS ensures consistency, however, this does not mean that there's no data loss. Writes are done in a transaction group, including an updated version of the b-tree. Only if all the new information has been written successfully the new b-tree "is tagged as valid" and becomes active. (Which is the reason why you can't rm files in a full pool.) If there's a power failure during a write ZFS recovers automatically during the mount (or zpool import, not sure on this one) _by deleting the inconsistent data_ and thus reverting to the last known state. Additionally, a transaction group may consist of several writes that reach a total size (I think 128Kb per default). If there are small and slow writes (e.g.to a Logfie) these are cached up to 30 seconds. If a power failure or any other kind of discruptive failure happens you'll loose all the information cached.