From owner-freebsd-geom@FreeBSD.ORG Thu Apr 28 10:40:53 2011 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AEC0A106566B for ; Thu, 28 Apr 2011 10:40:53 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 54F278FC12 for ; Thu, 28 Apr 2011 10:40:52 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id CAD6645CA6; Thu, 28 Apr 2011 12:40:50 +0200 (CEST) Received: from localhost (host-89-230-168-210.ostrowmaz.mm.pl [89.230.168.210]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id DE06045C8A; Thu, 28 Apr 2011 12:40:44 +0200 (CEST) Date: Thu, 28 Apr 2011 12:40:33 +0200 From: Pawel Jakub Dawidek To: Christian Baer Message-ID: <20110428104033.GA4898@garage.freebsd.pl> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="KsGdsel6WgEHnImy" Content-Disposition: inline In-Reply-To: X-OS: FreeBSD 9.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-2.6 required=4.5 tests=BAYES_00 autolearn=ham version=3.0.4 Cc: freebsd-geom@freebsd.org Subject: Re: 4K sectors on the drive, bigger sectors for geli and newfs? X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2011 10:40:53 -0000 --KsGdsel6WgEHnImy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 27, 2011 at 06:37:59PM +0200, Christian Baer wrote: > Hi folks! >=20 > A few days ago I installed a new drive that I would like to encrypt with > geli. It's one of the new ones with 4K sectors which means I have to > partition it differently than the older drives I have. >=20 > What I did so far: >=20 > gpart create -s gpt /dev/ad6 > gpart add -b 2048 -t freebsd-ufs /dev/ad6 >=20 > That should align the partition correctly. > pjd wrote in a post, that geli uses more than one key for larger file > systems, so I am quite happy to create a single (2TB) partion and file > system. >=20 > Due to the nature of the files that will mostly be stored on the drive > (digital photographs in raw format), my newfs will look something like > this (my idea): >=20 > newfs -L raw -O ufs2 -U -f 4096 -b 32768 -i 2097152 /dev/ad6p1.eli >=20 > An inode every 2^21 bytes should do fine. Most of the files on the drive > (I expect something like 90%) will be 7MB or larger. >=20 > Any objections so far? Would it make sense to make the frags and blocks > even larger? >=20 > Considering that, I'm wondering how to init geli, especially using the > -s option. >=20 > geli init -e aes-xts -l 256 -s $NUMBER /dev/ad6p1 >=20 > It stands to reason that $NUMBER should not be smaller than 4096 bytes > since the drive itself doesn't have anything smaller to offer. :-) What > would be a good value? 4096 or 32768 or something else? What does this > default to? It defaults to reported sector size of the underlying provider, so 512 bytes, I guess. In my opinion 4096 is optimal. Larger sectors are problematic, because if sector size it is larger than page size various tools will have problems with mmap(2)ing files. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --KsGdsel6WgEHnImy Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk25RCAACgkQForvXbEpPzSaaQCffWgeoIK72PvEq+jnhzVBhlKt GdIAn3VbNb62cU8088gTb3cfepzpwepG =dzeL -----END PGP SIGNATURE----- --KsGdsel6WgEHnImy--