From owner-freebsd-fs@FreeBSD.ORG Sat Oct 2 12:15:12 2010 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14BC3106564A for ; Sat, 2 Oct 2010 12:15:12 +0000 (UTC) (envelope-from ronald-freebsd8@klop.yi.org) Received: from smtp-out3.tiscali.nl (smtp-out3.tiscali.nl [195.241.79.178]) by mx1.freebsd.org (Postfix) with ESMTP id C9DF28FC14 for ; Sat, 2 Oct 2010 12:15:11 +0000 (UTC) Received: from [212.123.145.58] (helo=sjakie.klop.ws) by smtp-out3.tiscali.nl with esmtp (Exim) (envelope-from ) id 1P20no-0006rF-TI for freebsd-fs@freebsd.org; Sat, 02 Oct 2010 14:02:56 +0200 Received: from 212-123-145-58.ip.telfort.nl (localhost [127.0.0.1]) by sjakie.klop.ws (Postfix) with ESMTP id BE8D1424F for ; Sat, 2 Oct 2010 14:02:54 +0200 (CEST) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes To: freebsd-fs@freebsd.org References: Date: Sat, 02 Oct 2010 14:02:54 +0200 MIME-Version: 1.0 From: "Ronald Klop" Message-ID: In-Reply-To: User-Agent: Opera Mail/10.62 (FreeBSD) Content-Transfer-Encoding: quoted-printable Subject: Re: Data loss when hard shutdown! X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Oct 2010 12:15:12 -0000 On Sat, 02 Oct 2010 13:28:59 +0200, Phan Quoc Hien =20 wrote: > hello everybody. > I'm new to freebsd, When I hard shutdown my freebsd box..it caused lost= =20 > some > file. I used UFS2. How can prevent that? or recovery my file? > Thanks! > By hard shutdown you mean pulling the power plug? UFS2 (and most other filesystems on other operating systems) guarantee =20 consistency of metadata (filenames, directory structures, etc.) after a =20 crash. However it is possible to loose the last X seconds of unwritten =20 data. That can be the complete contents of a new file. If it is really important you can mount your filesystem 'sync' see 'man =20 mount' in which case it will become slow, but more up-to-date. Ronald.