From owner-freebsd-questions@FreeBSD.ORG Tue Oct 15 11:48:01 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6BDA0303 for ; Tue, 15 Oct 2013 11:48:01 +0000 (UTC) (envelope-from feenberg@nber.org) Received: from mail2.nber.org (mail2.nber.org [66.251.72.79]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3B2632939 for ; Tue, 15 Oct 2013 11:48:01 +0000 (UTC) Received: from nber4.nber.org (nber4.nber.org [66.251.72.74]) by mail2.nber.org (8.14.4/8.14.4) with ESMTP id r9FBltAq070278 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 15 Oct 2013 07:47:55 -0400 (EDT) (envelope-from feenberg@nber.org) Date: Tue, 15 Oct 2013 07:47:55 -0400 (EDT) From: Daniel Feenberg To: Polytropon Subject: Re: SU+J Lost files after a power failure In-Reply-To: <20131015073048.83d7bca4.freebsd@edvax.de> Message-ID: References: <525A6831.5070402@gmail.com> <20131014133953.58f74659@gumby.homeunix.com> <525C1D1C.9050708@gmail.com> <525C2554.7080203@pchotshots.com> <525C2FBC.4080808@cran.org.uk> <2351E8C5-4FC0-4AE9-AC21-312DA46C0EE8@mac.com> <20131015073048.83d7bca4.freebsd@edvax.de> User-Agent: Alpine 2.03 (LRH 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Anti-Virus: Kaspersky Anti-Virus for Linux Mail Server 5.6.39/RELEASE, bases: 20131015 #11251708, check: 20131015 clean Cc: FreeBSD Questions X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Oct 2013 11:48:01 -0000 On Tue, 15 Oct 2013, Polytropon wrote: > On Mon, 14 Oct 2013 14:04:45 -0700, Charles Swiger wrote: ... > > Unmounting a disk will usually make sure all remaining > buffers have been written. Given the previously described > stack of involved layers, it might still be good to be a > little bit paranoid regarding this assumption. :-) > We have a disk-to-disk backup that runs continuously. I have found that if I unmount the backup disk and remove it without delay, then sometimes it requires an fsck to remount. So I believe that umount does not wait for all writes to complete. I understand that buffers are written out to disk at least every 30 seconds, but it may take some time for the buffers to be flushed and the disk itself has a buffer and I have never seen any discussion of the maximum delay there. So the minimum wait for a safe removal remains unknown. Perhaps some trick like unmounting, then remounting with fsync, then unmounting would ensure all buffers were at least sent to the disk, but I have never seen that suggested. Daniel Feenberg