growing filesystems in 5-current

Terry Lambert tlambert2 at mindspring.com
Thu Apr 17 09:32:22 PDT 2003


Lukas Ertl wrote:
> Since growfs currently is not able to grow filesystems on vinum volumes in
> 5-current, I started playing around with it and hacked to following patch.
> On first look it seems to work, but there is still a problem I can't
> explain.

[ ... ]

> So far, so good. Then I attach another 32 MB subdisk to the plex and try
> my hacked growfs on it and I get this:
[ ... ]
> new file systemsize is: 32768 frags
> Warning: 16160 sector(s) cannot be allocated.
> growfs: 56.1MB (114912 sectors) block size 16384, fragment size 2048
>         using 7 cylinder groups of 8.02MB, 513 blks, 1088 inodes.
> super-block backups (for fsck -b #) at:
>  65824, 82240, 98656
> ---8<---
> 
> Why do I loose so many sectors there? Can you help me find the bug?

The simple answer is that you must be getting the size of the
underlying plex wrong, if you are really losing anything.

In reality, I think it's because you are expecting the stats
to apply to the whole range, and what's happening is that it's
only initializing the cylinder groups for the new part you
added.  The progression is:

	65824, 82240, 98656

If we project this backwards, we see:

	82240 - 65824 = 16416
	98656 - 82240 = 16416

So:

	65824 - 16416 = 49408 - 16416 = 32992 - 16416 = 16576

With a remainder of 160 for FS control structures or whatever.

So the previous progression was:

	160 (start)
	16576, 32992, 49408

...and also consists of 3 elements, following "start", so it
seems you aren't losing anything, at least to me.

Probably your patch is fine.

-- Terry


More information about the freebsd-fs mailing list