From owner-freebsd-questions@FreeBSD.ORG Sun Aug 22 14:14:46 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C60011065672 for ; Sun, 22 Aug 2010 14:14:46 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.cran.org.uk (muon.cran.org.uk [204.109.60.94]) by mx1.freebsd.org (Postfix) with ESMTP id A2DCF8FC0A for ; Sun, 22 Aug 2010 14:14:46 +0000 (UTC) Received: from unknown (client-86-31-88-103.midd.adsl.virginmedia.com [86.31.88.103]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by muon.cran.org.uk (Postfix) with ESMTPSA id 3A3855F11; Sun, 22 Aug 2010 14:14:42 +0000 (UTC) Date: Sun, 22 Aug 2010 15:14:58 +0100 From: Bruce Cran To: Roland Smith Message-ID: <20100822151458.000044c9@unknown> In-Reply-To: <20100819201700.GC33689@slackbox.erewhon.net> References: <20100819201700.GC33689@slackbox.erewhon.net> X-Mailer: Claws Mail 3.7.4cvs1 (GTK+ 2.16.0; i586-pc-mingw32msvc) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: EforeZZ , freebsd-questions Subject: Re: How to restore a text file from UFS?? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 14:14:46 -0000 On Thu, 19 Aug 2010 22:17:00 +0200 Roland Smith wrote: > For future reference; you should never edit files in /etc/ directly. > If you want ot edit files in /etc or /usr/local/etc, first copy them > to a directory in your $HOME, put them under revision control and > then edit them and copy the edited files to /etc. That way you always > have a backup and you can even restore previous versions. I've > documented the procedure I use on my webpage; > http://www.xs4all.nl/~rsmith/unix/configfiles.html This failure, where files are truncated to 0 bytes after an unclean shutdown isn't the same way ext4 was truncating files when using editors which overwrite files in-place (as opposed to writing to a temporary file then renaming) is it? Does calling fsync on FreeBSD not ensure that even with SoftUpdates the data is on the disk before the editor has exited? -- Bruce Cran