From owner-freebsd-questions@FreeBSD.ORG Thu Feb 28 13:58:07 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1F50FEE1 for ; Thu, 28 Feb 2013 13:58:07 +0000 (UTC) (envelope-from nvass@gmx.com) Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) by mx1.freebsd.org (Postfix) with ESMTP id 7CD5F6F3 for ; Thu, 28 Feb 2013 13:58:06 +0000 (UTC) Received: from mailout-eu.gmx.com ([10.1.101.214]) by mrigmx.server.lan (mrigmx001) with ESMTP (Nemesis) id 0M1kqC-1UzBnQ2ksE-00tlfq for ; Thu, 28 Feb 2013 14:52:54 +0100 Received: (qmail invoked by alias); 28 Feb 2013 13:52:54 -0000 Received: from 193.92.65.82.dsl.dyn.forthnet.gr (EHLO [127.0.0.1]) [193.92.65.82] by mail.gmx.com (mp-eu014) with SMTP; 28 Feb 2013 14:52:54 +0100 X-Authenticated: #46156728 X-Provags-ID: V01U2FsdGVkX19FxPNoDYtFUJNTB1l4IKk4ytlIJEwbmJReb9EC69 wwVh3xu9kM0kwQ Message-ID: <512F6132.8030903@gmx.com> Date: Thu, 28 Feb 2013 15:52:50 +0200 From: Nikos Vassiliadis User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: Alan Gutierrez Subject: Re: Journaling for a flaky FreeBSD VirtualBox guest. References: <20130228074139.GA34940@gmail.com> In-Reply-To: <20130228074139.GA34940@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Y-GMX-Trusted: 0 Cc: freebsd-questions@freebsd.org 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: Thu, 28 Feb 2013 13:58:07 -0000 On 28/2/2013 9:41 πμ, Alan Gutierrez wrote: > I'm getting to know FreeBSD by running a 64-bit FreeBSD guest in a VirtualBox > machine on my OS X Mountain Lion laptop. On occasion, when waking up from sleep, > the FreeBSD virtual machine will not restart. VirtualBox marks it as "Aborted." Maybe you should pause the guest before putting the host to sleep? > > When I restart FreeBSD, I've found on a number of occasions that the `.git` > directory of the project I was working on when my laptop went to sleep has > become corrupted. `git` won't recognize the directory. I try to rebuild the > repository with `git fsck`, but it's usually broken. My `.zsh_history` file has > been corrupted at restart, which I've recovered by removing the last line which > contains binary nonsense. > > I run a Linux guest that suffers the same abuse, but does not lose data. > > My question: > > If anyone runs FreeBSD in VirtualBox, what VirtualBox settings do you use so > that UFS will work correctly and recover recent writes? > > I'm using UFS built by the install media. > > % mount > /dev/ada0p2 on / (ufs, local, journaled soft-updates) > devfs on /dev (devfs, local, multilabel) > > I'm using the disk and disk controller setup that VirtualBox suggested when when > I told it I was building a FreeBSD machine. A single IDE drive on an IDE > controller with "Use host I/O cache enabled." The VirtualBox documentation says > that a virtual SATA controller is preferred if you choose to uncheck "Use host > I/O cache enabled." > > http://www.virtualbox.org/manual/ch05.html#iocaching > > So... > > * How should I configure my filesystem for maximum durability, since the > VirtualBox virtual drives appear to be flaky? I think geom_journal will serve you better for this purpose. Geom journal records everything, that is data and metadata changes. I have used geom journal on my freebsd-current box and it has stood tenths of kernel panics and a few power-offs without a single failure. I haven't researched about the type of controller or other settings since it was never needed to. Occasional full fscks never revealed corruption. Just my 2 cents, HTH, Nikos