understanding block distribution in UFS2 filesystems

Rick C. Petty rick-freebsd2009 at kiwi-computer.com
Mon Sep 20 22:40:54 UTC 2010


On Mon, Sep 20, 2010 at 03:56:41PM -0500, Jamie Ostrowski wrote:
>     I thought I understood how block distribution in UFS2 filesystems work,
> until I tried running dumpfs on one of my filesystems. The output really
> confused me, and the man page doesn't get into detail in explaining the
> output. Can anyone explain why I am seeing references to the same "free
> blocks" in different cylinder groups?
> 
>     I thought that the block numbers were unique across the entire
> filesystem, but from the output of dumpfs, I see references to free blocks
> 0-7 in almost every cylinder group.

I suspect the block numbers (which are actually fragment numbers) are
relative to each cylinder group.  Blocks 0-7 are free in all cylinder
groups except the first one, which is used for bootstrap.

>     So are the blocks that are in each cylinder group numbered start over
> with a new block 0 in each cylinder group?
> 
> In other words, which picture below is true, A, or B:
> 
> 
> Cylinder group 0: Uses blocks 0-4000
> Cylinder group 1: Uses blocks 4001-8000
> Cylinder group 2: Uses blocks 8001-12000

This is correct.  Each cylinder group contains its own bitmap of free
space, a copy of the super block, and the inodes for that group.

-- Rick C. Petty


More information about the freebsd-fs mailing list