block and fragment sizes with newfs

David Kelly dkelly at HiWAAY.net
Wed Apr 23 18:27:43 PDT 2003


On Wednesday 23 April 2003 02:37 pm, Erik Trulsson wrote:
> On Wed, Apr 23, 2003 at 11:34:10AM -0500, David Kelly wrote:
>
> In general you have that:
> large block size/fragment size => fast operation, lots of wasted
> space small block size/fragment size => slower operation, little
> wasted space
>
> For a solid state device (like flash memory) I suspect that the speed
> loss for smaller blocksizes would be less than it would be for a
> normal disk.
>
> I would suggest you try different block sizes and if there is no
> noticable speed difference between them you should use the smallest
> one (that would be 4096/512 for block/fragment size.) If there is a
> speed difference you would have to decide which is more important:
> speed or space.

Since posting earlier I took a 256MB CF card and made two partitions of 
exactly the same size, about 128 MB each. Newfs'ed one at 8192/1024 and 
the other at 4096/512. Then extracted my 30MB tar image to each. The 
bigger block/fragment was about 15:50 while the smaller was 15:10, a 
bit faster. Have not repeated this exercise with the partitions 
reversed. Quite frankly the times were too close to matter either way.

Comparing the space on the filesystem the bigger blocks show more space 
with "df -k" but also took more space to write the files. When 
comparing percentage of the fs in use they don't differ until the 2nd 
or 3rd place past the decimal.

So lacking any other insight as to what is happening I'm sticking with 
4096/512 in the hopes it minimizes wear and tear on my CF media.

-- 
David Kelly N4HHE, dkelly at hiwaay.net
=====================================================================
The human mind ordinarily operates at only ten percent of its
capacity -- the rest is overhead for the operating system.


More information about the freebsd-questions mailing list