Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Aug 2009 07:28:14 +0200
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        Naeem Afzal <nafzal@hotmail.com>
Cc:        freebsd-fs@freebsd.org
Subject:   Re: filesystem size after newfs
Message-ID:  <20090812052814.GD1600@garage.freebsd.pl>
In-Reply-To: <COL111-W50B8F353BF8FD65761B242D1040@phx.gbl>
References:  <COL111-W23AF31CB4D2944209932C6D1070@phx.gbl> <20090811191837.GB66530@keira.kiwi-computer.com> <COL111-W50B8F353BF8FD65761B242D1040@phx.gbl>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090812052814.GD1600>