filesystem size after newfs

Naeem Afzal nafzal at hotmail.com
Wed Aug 12 00:16:10 UTC 2009


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



>
> There are a number of things of which you should be careful. Using UFS1,
> you won't be able to use bootstrap code larger than 8k and you won't be
> able to use large files (not a problem because your filesystem is only
> 512k). You also won't get snapshots, which you apparently don't want.
>
> Specifying inode density can put you in a bind if you need a lot of
> inodes. In my example there are exactly 16 inodes, which is somewhat
> limited. The first three inodes are reserved (2 is the root inode) which
> leaves you with a maximum of 13 files and/or directories. I'm assuming
> this isn't a problem since you're using such a small filesystem. The
> smaller block and fragment sizes help reduce the "wasted space" taken up
> by filesystem metadata, but will require some tuning if you want more
> inodes. Be sure that only one cylinder group is created, or you'll be
> wasting 16k or more for each cylinder group.
>
> I also recommend keeping the 8:1 ratio of blocks to fragments. If you do
> wish to tweak that, here are a few things to note. Minimum blocksize is
> 4096 and at least 4 blocks are allocated for each cylinder group (in
> addition to the leading 64k). More blocks are allocated if the inode
> density is higher (specifying a lower number to "newfs -i"). UFS1 can fit
> twice as many inodes in the same space as UFS2, which is why I recommend
> using it with very small filesystems. Since filesystem metadata is always
> allocated in blocks, it doesn't really help to tweak the fragment size.
>
> At one time I was thinking of writing up a patch to newfs to allow you
> specify the superblock offset, so you could save 16-64k per cylinder
> group. But there are limitations, since the FFS code searches for
> superblocks at specific offsets, namely (in order): 64k, 8k, 0, 256k.
> I also had thoughts about patching it to remove the superblock backup, so
> that fs_sblkno could be 0 instead of 144 or 32. Because of its structure,
> at least 16k (8k bootstrap plus 8k initial superblock) is unused for every
> cylinder group in UFS1 (at least 72k for UFS2).
>
> There isn't much to be gained in such a patch except for very small
> filesystems such as in your case. When you're dealing with 512k, that
> extra 16k (or more) is starting to look significant (3%).
>
> HTH,
>
> -- Rick C. Petty

_________________________________________________________________
Get free photo software from Windows Live
http://www.windowslive.com/online/photos?ocid=PID23393::T:WLMTAGL:ON:WL:en-US:SI_PH_software:082009


More information about the freebsd-fs mailing list