[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Returning true available space on jffs f/s



On Fri, 23 Feb 2001, Vipin Malik wrote:

First of all thanks to you (and David) for patching this
io error. It was just right in time for me :-)

> The "df" command is really interesting to watch when one is writing to a
> jffs file system where there are older deleted files.
> The "% free" jumps all over the place, you can actually do a "df", write
> some data to the jffs partition, do "df" again and see
> the amount of free space actually *increase*!

free space? you mean used space.
I wrote a small cp test script, which copies /usr/bin to /usr/local/bin
(on my strongarm/ipaq) compares every file in /usr/local/bin and /usr/bin
and than after that /usr/local/bin is removed again.
Here are some of the df outputs of what I have done:

/dev/mtdblock6            2048      1508       540  74% /usr/local
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/mtdblock6            2048        28      2020   1% /usr/local
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/mtdblock6            2048      1532       516  75% /usr/local
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/mtdblock6            2048       304      1744  15% /usr/local
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/mtdblock6            2048      1556       492  76% /usr/local
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/mtdblock6            2048        68      1980   3% /usr/local
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/mtdblock6            2048      1576       472  77% /usr/local
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/mtdblock6            2048        80      1968   4% /usr/local
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/mtdblock6            2048      1584       464  77% /usr/local
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/mtdblock6            2048       108      1940   5% /usr/local
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/mtdblock6            2048      1616       432  79% /usr/local
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/mtdblock6            2048       140      1908   7% /usr/local

and so on ...
as you mention the use space increases.
After reaching about 15% to 18% (I don't remeber the gc policity
exact) the gc starts and you'll (I saw) see a used space of 1%
again...
For me that's ok and I have no errors recognized after more than
100000 writes/reads on that filesystem.


> But more important than interesting, is the practical fact, that
> embedded systems, have to garbage collect older logs etc, that
> are only deleted when space for the new logs is getting thin. The only
> way I know of getting that info is through statfs. If statfs
> does not return a correct number, it is likely to throw off the log gc
> program.

How do you mean that? IMHO as long as there is min_free_size no
logger has any problem. When some logfiles grow and free_size
becomes less than min_free_size -- gc ist started and you get
more space. There are no problems with marked dirty pages.
But I see your problem -- there is hidden free space on that device
and statfs won't give you the right value.

-- 
--------------------------------------
++ axel (barney) barnitzke
++ it consultant
++ lisa systems


email :: mailto:barney@xxxxxxx.de



To unsubscribe from this list: send the line "unsubscribe jffs-dev" in
the body of a message to majordomo@xxxxxxx.com