filesystem size after newfs

Pawel Jakub Dawidek pjd at FreeBSD.org
Wed Aug 12 05:28:27 UTC 2009


On Wed, Aug 12, 2009 at 12:16:09AM +0000, Naeem Afzal wrote:
> 
> Thanks you so much that was good explanation. 
> 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). 
> One more thing, I tried to make the same partition as geli with HMAC/SHA256 authentication and it eats up even more space. Without this authentication, 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.eli/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
> 
> 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

-- 
Pawel Jakub Dawidek                       http://www.wheel.pl
pjd at FreeBSD.org                           http://www.FreeBSD.org
FreeBSD committer                         Am I Evil? Yes, I Am!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-fs/attachments/20090812/0628d135/attachment.pgp


More information about the freebsd-fs mailing list