Optimizing UFS 1/2 for non-rotating / compressed storage

Maxim Sobolev sobomax at freebsd.org
Wed Jul 20 18:45:04 UTC 2016


Hi Kirk et al,

Do you by any chance have some hints of what parameters we need to set in
newfs to maximally fit the following criteria:

1. Minimize free space fragmentation, i.e. we start with huge array or
zeroes, we want to end up with as few number of continuous zero areas as
possible (i.e. minimize free space discontinuity).

2. Blocks that belong to the same file should be as continuous as possible
"on disk".

3. Each individual file should preferably start at the block offset that is
multiple of certain pre-defined power-of-two size from the start of
partition, e.g. 64k, 128k etc.

The file system in question is write-mostly. We create image from scratch
every time and them populate with installworld + pkg add. Any free space is
subsequently erased with dd if=/dev/zero of=/myfs/bigfile; rm
/myfs/bigfile, unmounted and image is compressed. We also grossly
over-provision space, i.e. 2GB UFS image is created, less than 1GB is used
at the end.

Any hints would be appreciated. Thanks!

-Maxim


More information about the freebsd-fs mailing list