From owner-freebsd-fs@FreeBSD.ORG Sun Jul 10 01:15:56 2011 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 9992C106564A for ; Sun, 10 Jul 2011 01:15:56 +0000 (UTC) (envelope-from peterjeremy@acm.org) Received: from mail18.syd.optusnet.com.au (mail18.syd.optusnet.com.au [211.29.132.199]) by mx1.freebsd.org (Postfix) with ESMTP id E6FCF8FC0C for ; Sun, 10 Jul 2011 01:15:55 +0000 (UTC) Received: from server.vk2pj.dyndns.org (c220-239-116-103.belrs4.nsw.optusnet.com.au [220.239.116.103]) by mail18.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p6A1FpPA015337 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 10 Jul 2011 11:15:53 +1000 X-Bogosity: Ham, spamicity=0.000000 Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by server.vk2pj.dyndns.org (8.14.4/8.14.4) with ESMTP id p6A1FokP001283; Sun, 10 Jul 2011 11:15:50 +1000 (EST) (envelope-from peter@server.vk2pj.dyndns.org) Received: (from peter@localhost) by server.vk2pj.dyndns.org (8.14.4/8.14.4/Submit) id p6A1Fnt2001282; Sun, 10 Jul 2011 11:15:49 +1000 (EST) (envelope-from peter) Date: Sun, 10 Jul 2011 11:15:49 +1000 From: Peter Jeremy To: Rick van der Zwet Message-ID: <20110710011549.GA88534@server.vk2pj.dyndns.org> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="17pEHd4RhPHOinZp" Content-Disposition: inline In-Reply-To: X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-fs@freebsd.org Subject: Re: fsck_ufs a 2TB partition with 256MB RAM stalls 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: Sun, 10 Jul 2011 01:15:56 -0000 --17pEHd4RhPHOinZp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2011-Jul-07 15:57:52 +0200, Rick van der Zwet w= rote: >I want to build a file server with limited power usage, so I got >myself an ALIX alix2d13 which has 256MB DDR RAM. I connected a 2TB >USB2.0 disk to the alix2d13 to be used as storage. > >The file system gets corrupted due to power failure, which is likely >going to happen when running Solar Power in The Netherlands, I cannot >fix it anymore cause the fsck_ufs never to complete. This actually >makes sense as the recommendation [1] says ``1TB storage needs 1GB of >RAM for fsck_ufs''. The problem is that fsck allocates both per-CG and per-allocated-inode space (and possibly other space) so running fsck on a large UFS needs lots of RAM. I suspect you'll need to find an amd64 box to run the fsck on but you might be able to get the fsck to complete (very slowly) by adding plenty of swap (on another disk) and increasing kern.maxdsiz in loader.conf. >I can partition my disk in 16 parts of 128GB to work around the >matter, but I rather keep one large partition. That's probably the best solution but you could reduce the need to run fsck by: - Arrange an "about to run flat" warning from your battery to allow clean shutdown. - Use SU+J (the journal file should remove the need for fsck in almost all situations) - don't fsck on all unclean startups - soft-updates means that it's safe (or should be) to mount and continue to use a "dirty" FS - the downside is that you may be missing some free space. If you have ready access to an amd64 box, then a combination of the above may be workable. Note that if your disk loses power uncleanly, it's fairly important to disable the write-cache (or at least do some tests to verify that synchronous writes make it to the platter before being acknowledged). If synchronous writes aren't guaranteed to be on-disk then you can't rely on soft-updates, with or without journalling, and must do full fsck if the FS is unclean. --=20 Peter Jeremy --17pEHd4RhPHOinZp Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) iEYEARECAAYFAk4Y/UUACgkQ/opHv/APuIdWawCeKbGK3QMaaNeOvXuFAvcp3DIw /tMAoLbA0Ysm3qktV6tsJ1DdsayQBLJB =5Qb7 -----END PGP SIGNATURE----- --17pEHd4RhPHOinZp--