From owner-freebsd-fs@FreeBSD.ORG Wed Aug 12 05:28:26 2009 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 94AB5106566C for ; Wed, 12 Aug 2009 05:28:26 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello087206049004.chello.pl [87.206.49.4]) by mx1.freebsd.org (Postfix) with ESMTP id B5AD68FC15 for ; Wed, 12 Aug 2009 05:28:25 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 68D9945CD8; Wed, 12 Aug 2009 07:28:22 +0200 (CEST) Received: from localhost (chello087206049004.chello.pl [87.206.49.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 3D78A45C8A; Wed, 12 Aug 2009 07:28:17 +0200 (CEST) Date: Wed, 12 Aug 2009 07:28:14 +0200 From: Pawel Jakub Dawidek To: Naeem Afzal Message-ID: <20090812052814.GD1600@garage.freebsd.pl> References: <20090811191837.GB66530@keira.kiwi-computer.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="mR8QP4gmHujQHb1c" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 8.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: freebsd-fs@freebsd.org Subject: Re: filesystem size after newfs 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: Wed, 12 Aug 2009 05:28:27 -0000 --mR8QP4gmHujQHb1c Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 12, 2009 at 12:16:09AM +0000, Naeem Afzal wrote: >=20 > Thanks you so much that was good explanation.=20 > For some reason using UFS1 or UFS2 did not make any size difference after= I changed the block size and fragment size to minimum (4K/512).=20 > One more thing, I tried to make the same partition as geli with HMAC/SHA2= 56 authentication and it eats up even more space. Without this authenticati= on, usage is pretty close to without geli. > #geli init -a HMAC/SHA256 -P -K da2-64bytes.key /dev/ad1d > # newfs -O 1 -U -l -m 0 -n -o space -f 512 -b 4096 -i 1048576 /dev/ad1d.e= li/dev/ad1d.eli: 0.2MB (511 sectors) block size 4096, fragment size 512 = using 1 cylinder groups of 0.25MB, 63 blks, 32 inodes. with soft= updatessuper-block backups (for fsck -b #) at: 32 > #df -H /testFilesystem 1K-blocks Used Avail Capacity Mounted on/= dev/ad1d.eli 228k 512B 228k 0% /test >=20 > ada1.eli should have been 0.5MB, but seems like it is reserving some area= for geli? How much is needed for HMAC/SHA256? What is allocation scheme if= we go for this SHA256 authentication? > regardsnaeem To ensure atomicity of operations, geli stores hashes in the same sector as the data. Creating geli providers with block size of 512 bytes is very inefficient. It will consume two sectors for each sector, which looks like this: 1 512b of data -----> 480b for data + 32b for hash 2 32b for data + 32b for hash + 448b unused The most optimal block size for geli provider is 4kB, it consumes one extra sector for every 8 sectors: 1 512b of data -----> 480b for data + 32b for hash 2 512b of data 480b for data + 32b for hash 3 512b of data 480b for data + 32b for hash 4 512b of data 480b for data + 32b for hash 5 512b of data 480b for data + 32b for hash 6 512b of data 480b for data + 32b for hash 7 512b of data 480b for data + 32b for hash 8 512b of data 480b for data + 32b for hash 9 256b for data + 32b for hash + 224 unused --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --mR8QP4gmHujQHb1c Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFKglLuForvXbEpPzQRAmVaAJwNup9PAnDdQ5/qY7V1se9kG8x5YwCgxgR7 wWj9/H4/ZSvIb0X6N8czFu0= =P4XR -----END PGP SIGNATURE----- --mR8QP4gmHujQHb1c--