If you look in /proc/mtd, you see that the flash-erase-size is
detected to 0x10000 = 64kb for the mtd4 area.

ewrt ~# df
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/root                 2816      2816         0 100% /
/dev/mtdblock/4            320       132       188  41% /opt

ewrt ~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00040000 00010000 "pmon"
mtd1: 003b0000 00010000 "linux"
mtd2: 002b439e 00010000 "rootfs"
mtd3: 00010000 00010000 "nvram"
mtd4: 00050000 00010000 "jffs2"

When you are going to write something to the jffs2 filesystem, then
you should have some reserved blocks to write your changes, and
when the operation is done the old block is erased.

Normally a flash contains more than 64 separate erase-blocks,
and in that case it's no bid deal if 3-5 blocks are reserved to
for write-changes.
But in this case there are only 5 blocks left (0x50000 bytes) in the
flash for the jffs2-filesystem, and then we have to tweek those
reserved blocks to make it possible to have a filesystem at all.

128kb is always marked used since they are reserved according
to the nodelist.h. (2 blocks)
(If you have a 8Mb flash with two erase-blocks (I don't know if it
exists), it will be 100% full after creating a jffs2-filesystem.)

If you add more binaries to the root-filesystem, mtd2 will grow and
sooner or latest you will only have 0x40000 bytes available for your
jffs2-filesystem, and only 128kb free when empty.

/Christian


On Thu, 2005-06-16 at 13:00 -0400, Paul Hilton wrote:
> Christian,
> 
> thanks for the patch, it does the job just fine, /opt now shows 188 1k
> blocks available.
> 
> What size blocks does JFFS2_RESERVED_BLOCKS_... refer to though? The
> patch reduces it from 3 to 1, or 5 to 2 to allow a write, but that still
> results in df showing 132 1k blocks as used.
> 
> Paul Hilton
> 
> On Wed, 2005-06-15 at 23:29 +0200, Christian Magnusson wrote:
> > Oops... I'm so sorry for missing a patch to the kernel that I made.
> > ewrt works good with the current settings, but since my patches add
> > some more binaries to the flash-memory, there are much less memory
> > left for the jffs2 file-system.
> > 
> > To solve the problem I patched 
> > ewrt-0.3/src/linux/linux/fs/jffs2/nodelist.h
> > and decreased the number of reserved blocks for the system. There
> > _might_ be a problem if many processes write to the /opt directory
> > at the same time, but otherwise it should work just fine.
> > 
> > Download the patch from:
> > http://home.mag.cx/uclinux/wrt54g/source/jffs2_diff.txt
> > 
> > You might need to clean the kernel-directory, or perhaps only
> > linux/fs/jffs2/*.o, or perhaps the dependencies will recompile
> > the necessary files automatically after the patch. I'm not sure...
> > 
> > I will add this patch in the next source-tar-file... Thanks for
> > pointing it out for me... :)
> > 
> > /Christian
> > 
> > 
> 
> 
> 
> 
> -------------------------------------------------------
> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
> from IBM. Find simple to follow Roadmaps, straightforward articles,
> informative Webcasts and more! Get everything you need to get up to
> speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
> _______________________________________________
> Owfs-developers mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/owfs-developers
-- 
Christian Magnusson <[EMAIL PROTECTED]>



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Owfs-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to